rtl8188eu: P_opulate new kernel branch

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-11-28 11:08:37 -06:00
parent adfd7de95d
commit 5105d48231
44 changed files with 295 additions and 225 deletions

View file

@ -361,7 +361,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
param->u.crypt.err = 0;
param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0';
if (param_len < (u32)((u8 *)param->u.crypt.key - (u8 *)param) + param->u.crypt.key_len) {
if (param_len < (u32) ((u8 *)param->u.crypt.key - (u8 *)param) + param->u.crypt.key_len) {
ret = -EINVAL;
goto exit;
}
@ -512,12 +512,14 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
}
if (ielen) {
buf = kmemdup(pie, ielen, GFP_KERNEL);
buf = kzalloc(ielen, GFP_KERNEL);
if (buf == NULL) {
ret = -ENOMEM;
goto exit;
}
memcpy(buf, pie, ielen);
/* dump */
{
int i;
@ -1134,8 +1136,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
struct iw_scan_req *req = (struct iw_scan_req *)extra;
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
int len = min_t(int, req->essid_len,
IW_ESSID_MAX_SIZE);
int len = min((int)req->essid_len, IW_ESSID_MAX_SIZE);
memcpy(ssid[0].Ssid, req->essid, len);
ssid[0].SsidLength = len;
@ -1416,7 +1417,7 @@ static int rtw_wx_set_rate(struct net_device *dev,
struct iw_request_info *a,
union iwreq_data *wrqu, char *extra)
{
int i;
int i, ret = 0;
u8 datarates[NumRates];
u32 target_rate = wrqu->bitrate.value;
u32 fixed = wrqu->bitrate.fixed;
@ -1489,7 +1490,7 @@ set_rate:
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("datarate_inx =%d\n", datarates[i]));
}
return 0;
return ret;
}
static int rtw_wx_get_rate(struct net_device *dev,
@ -2698,8 +2699,10 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param,
ie_len = len-12-2;/* 12 = param header, 2:no packed */
kfree(pmlmepriv->wps_beacon_ie);
pmlmepriv->wps_beacon_ie = NULL;
if (pmlmepriv->wps_beacon_ie) {
kfree(pmlmepriv->wps_beacon_ie);
pmlmepriv->wps_beacon_ie = NULL;
}
if (ie_len > 0) {
pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len);
@ -2733,8 +2736,10 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par
ie_len = len-12-2;/* 12 = param header, 2:no packed */
kfree(pmlmepriv->wps_probe_resp_ie);
pmlmepriv->wps_probe_resp_ie = NULL;
if (pmlmepriv->wps_probe_resp_ie) {
kfree(pmlmepriv->wps_probe_resp_ie);
pmlmepriv->wps_probe_resp_ie = NULL;
}
if (ie_len > 0) {
pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len);
@ -2763,8 +2768,10 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par
ie_len = len-12-2;/* 12 = param header, 2:no packed */
kfree(pmlmepriv->wps_assoc_resp_ie);
pmlmepriv->wps_assoc_resp_ie = NULL;
if (pmlmepriv->wps_assoc_resp_ie) {
kfree(pmlmepriv->wps_assoc_resp_ie);
pmlmepriv->wps_assoc_resp_ie = NULL;
}
if (ie_len > 0) {
pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len);

View file

@ -512,6 +512,7 @@ void rtw_proc_remove_one(struct net_device *dev)
static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
{
uint status = _SUCCESS;
struct registry_priv *registry_par = &padapter->registrypriv;
@ -526,7 +527,7 @@ static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
registry_par->channel = (u8)rtw_channel;
registry_par->wireless_mode = (u8)rtw_wireless_mode;
registry_par->vrtl_carrier_sense = (u8)rtw_vrtl_carrier_sense;
registry_par->vrtl_carrier_sense = (u8)rtw_vrtl_carrier_sense ;
registry_par->vcs_type = (u8)rtw_vcs_type;
registry_par->rts_thresh = (u16)rtw_rts_thresh;
registry_par->frag_thresh = (u16)rtw_frag_thresh;
@ -581,7 +582,7 @@ static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
snprintf(registry_par->ifname, 16, "%s", ifname);
snprintf(registry_par->if2name, 16, "%s", if2name);
registry_par->notch_filter = (u8)rtw_notch_filter;
return _SUCCESS;
return status;
}
static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
@ -759,6 +760,7 @@ void rtw_stop_drv_threads(struct adapter *padapter)
static u8 rtw_init_default_value(struct adapter *padapter)
{
u8 ret = _SUCCESS;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -801,11 +803,12 @@ static u8 rtw_init_default_value(struct adapter *padapter)
padapter->bWritePortCancel = false;
padapter->bRxRSSIDisplay = 0;
padapter->bNotifyChannelChange = 0;
return _SUCCESS;
return ret;
}
u8 rtw_reset_drv_sw(struct adapter *padapter)
{
u8 ret8 = _SUCCESS;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
@ -830,7 +833,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
rtw_set_signal_stat_timer(&padapter->recvpriv);
return _SUCCESS;
return ret8;
}
u8 rtw_init_drv_sw(struct adapter *padapter)

View file

@ -51,7 +51,7 @@ void *rtw_malloc2d(int h, int w, int size)
{
int j;
void **a = kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL);
void **a = (void **)kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL);
if (a == NULL) {
pr_info("%s: alloc memory fail!\n", __func__);
return NULL;

View file

@ -148,21 +148,36 @@ static int rtw_android_set_block(struct net_device *net, char *command,
int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
{
int ret = 0;
char *command;
char *command = NULL;
int cmd_num;
int bytes_written = 0;
struct android_wifi_priv_cmd priv_cmd;
if (!ifr->ifr_data)
return -EINVAL;
if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(priv_cmd)))
return -EFAULT;
if (priv_cmd.total_len < 1)
return -EINVAL;
command = memdup_user(priv_cmd.buf, priv_cmd.total_len);
if (IS_ERR(command))
return PTR_ERR(command);
command[priv_cmd.total_len - 1] = 0;
if (!ifr->ifr_data) {
ret = -EINVAL;
goto exit;
}
if (copy_from_user(&priv_cmd, ifr->ifr_data,
sizeof(struct android_wifi_priv_cmd))) {
ret = -EFAULT;
goto exit;
}
command = kmalloc(priv_cmd.total_len, GFP_KERNEL);
if (!command) {
DBG_88E("%s: failed to allocate memory\n", __func__);
ret = -ENOMEM;
goto exit;
}
if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) {
DBG_88E("%s: failed to access memory\n", __func__);
ret = -EFAULT;
goto exit;
}
if (copy_from_user(command, (char __user *)priv_cmd.buf,
priv_cmd.total_len)) {
ret = -EFAULT;
goto exit;
}
DBG_88E("%s: Android private cmd \"%s\" on %s\n",
__func__, command, ifr->ifr_name);
cmd_num = rtw_android_cmdstr_to_num(command);
@ -176,7 +191,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
DBG_88E("%s: Ignore private cmd \"%s\" - iface %s is down\n",
__func__, command, ifr->ifr_name);
ret = 0;
goto free;
goto exit;
}
switch (cmd_num) {
case ANDROID_WIFI_CMD_STOP:
@ -264,7 +279,7 @@ response:
} else {
ret = bytes_written;
}
free:
exit:
kfree(command);
return ret;
}

View file

@ -556,6 +556,8 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("-dev_remove()\n"));
DBG_88E("-r871xu_dev_remove, done\n");
return;
}
static struct usb_driver rtl8188e_usb_drv = {

View file

@ -160,10 +160,10 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
switch (haldata->UsbRxAggMode) {
case USB_RX_AGG_DMA:
case USB_RX_AGG_MIX:
pkt_offset = (u16)round_up(pkt_offset, 128);
pkt_offset = (u16) round_up(pkt_offset, 128);
break;
case USB_RX_AGG_USB:
pkt_offset = (u16)round_up(pkt_offset, 4);
pkt_offset = (u16) round_up(pkt_offset, 4);
break;
case USB_RX_AGG_DISABLE:
default:
@ -843,7 +843,7 @@ void usb_write_port_cancel(struct adapter *padapter)
void rtl8188eu_recv_tasklet(void *priv)
{
struct sk_buff *pskb;
struct adapter *adapt = priv;
struct adapter *adapt = (struct adapter *)priv;
struct recv_priv *precvpriv = &adapt->recvpriv;
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
@ -862,7 +862,7 @@ void rtl8188eu_recv_tasklet(void *priv)
void rtl8188eu_xmit_tasklet(void *priv)
{
int ret = false;
struct adapter *adapt = priv;
struct adapter *adapt = (struct adapter *)priv;
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY))

View file

@ -46,7 +46,7 @@ void _rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
}
uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen)
{
uint len = 0;