mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Fix some sparse errors
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
78adabf36d
commit
4342c7358c
29 changed files with 721 additions and 727 deletions
|
@ -197,7 +197,7 @@ static void request_wps_pbc_event(_adapter *padapter)
|
|||
|
||||
p=buff;
|
||||
|
||||
p+=sprintf(p, "WPS_PBC_START.request=TRUE");
|
||||
p+=sprintf(p, "WPS_PBC_START.request=true");
|
||||
|
||||
_rtw_memset(&wrqu,0,sizeof(wrqu));
|
||||
|
||||
|
@ -4801,7 +4801,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
|
|||
{
|
||||
u16 type = 0;
|
||||
|
||||
_rtw_memcpy(&type, dev_type, 2);
|
||||
memcpy(&type, dev_type, 2);
|
||||
type = be16_to_cpu(type);
|
||||
sprintf(dev_type_str, "\n\nN=%.2d", type);
|
||||
blnMatch = 1;
|
||||
|
@ -6194,7 +6194,7 @@ static int rtw_p2p_get2(struct net_device *dev,
|
|||
struct wifidirect_info *pwdinfo= &(padapter->wdinfo);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
DBG_88E("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer);
|
||||
DBG_88E("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer);
|
||||
|
||||
if (_rtw_memcmp(extra, "wpsCM=", 6))
|
||||
{
|
||||
|
@ -9663,132 +9663,122 @@ static int rtw_mp_read_reg(struct net_device *dev,
|
|||
struct iw_request_info *info,
|
||||
struct iw_point *wrqu, char *extra)
|
||||
{
|
||||
char input[wrqu->length];
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
char *pch, *pnext, *ptmp;
|
||||
char *width_str;
|
||||
char width;
|
||||
char data[20],tmp[20];
|
||||
u32 addr;
|
||||
//u32 *data = (u32*)extra;
|
||||
u32 ret, i=0, j=0, strtout=0;
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
|
||||
|
||||
if (wrqu->length > 128)
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
}
|
||||
_rtw_memset(data, 0, 20);
|
||||
_rtw_memset(tmp, 0, 20);
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
|
||||
pch = input;
|
||||
pnext = strpbrk(pch, " ,.-");
|
||||
if (pnext == NULL) return -EINVAL;
|
||||
if (pnext == NULL) {
|
||||
kfree(input);
|
||||
return -EINVAL;
|
||||
}
|
||||
*pnext = 0;
|
||||
width_str = pch;
|
||||
|
||||
pch = pnext + 1;
|
||||
if ((pch - input) >= wrqu->length) return -EINVAL;
|
||||
|
||||
if ((pch - input) >= wrqu->length) {
|
||||
kfree(input);
|
||||
return -EINVAL;
|
||||
}
|
||||
kfree(input);
|
||||
addr = simple_strtoul(pch, &ptmp, 16);
|
||||
if (addr > 0x3FFF) return -EINVAL;
|
||||
if (addr > 0x3FFF)
|
||||
return -EINVAL;
|
||||
|
||||
ret = 0;
|
||||
width = width_str[0];
|
||||
switch (width)
|
||||
{
|
||||
case 'b':
|
||||
// 1 byte
|
||||
// *(u8*)data = rtw_read8(padapter, addr);
|
||||
sprintf(extra, "%d\n", rtw_read8(padapter, addr));
|
||||
wrqu->length = strlen(extra);
|
||||
break;
|
||||
case 'w':
|
||||
// 2 bytes
|
||||
//*(u16*)data = rtw_read16(padapter, addr);
|
||||
sprintf(data, "%04x\n", rtw_read16(padapter, addr));
|
||||
for (i=0 ; i <= strlen(data) ; i++)
|
||||
{
|
||||
if (i%2==0)
|
||||
{
|
||||
tmp[j]=' ';
|
||||
j++;
|
||||
}
|
||||
if (data[i] != '\0')
|
||||
tmp[j] = data[i];
|
||||
switch (width) {
|
||||
case 'b':
|
||||
// 1 byte
|
||||
// *(u8*)data = rtw_read8(padapter, addr);
|
||||
sprintf(extra, "%d\n", rtw_read8(padapter, addr));
|
||||
wrqu->length = strlen(extra);
|
||||
break;
|
||||
case 'w':
|
||||
// 2 bytes
|
||||
//*(u16*)data = rtw_read16(padapter, addr);
|
||||
sprintf(data, "%04x\n", rtw_read16(padapter, addr));
|
||||
for (i=0 ; i <= strlen(data) ; i++) {
|
||||
if (i%2==0) {
|
||||
tmp[j]=' ';
|
||||
j++;
|
||||
}
|
||||
if (data[i] != '\0')
|
||||
tmp[j] = data[i];
|
||||
j++;
|
||||
}
|
||||
pch = tmp;
|
||||
DBG_88E("pch=%s",pch);
|
||||
|
||||
j++;
|
||||
}
|
||||
pch = tmp;
|
||||
DBG_88E("pch=%s",pch);
|
||||
while (*pch != '\0') {
|
||||
pnext = strpbrk(pch, " ");
|
||||
if (!pnext)
|
||||
break;
|
||||
|
||||
while (*pch != '\0')
|
||||
{
|
||||
pnext = strpbrk(pch, " ");
|
||||
if (!pnext)
|
||||
break;
|
||||
pnext++;
|
||||
if (*pnext != '\0') {
|
||||
strtout = simple_strtoul (pnext , &ptmp, 16);
|
||||
sprintf(extra, "%s %d" ,extra ,strtout);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
pch = pnext;
|
||||
}
|
||||
wrqu->length = 6;
|
||||
break;
|
||||
case 'd':
|
||||
// 4 bytes
|
||||
//*data = rtw_read32(padapter, addr);
|
||||
sprintf(data, "%08x", rtw_read32(padapter, addr));
|
||||
//add read data format blank
|
||||
for (i=0 ; i <= strlen(data) ; i++) {
|
||||
if (i%2==0) {
|
||||
tmp[j]=' ';
|
||||
j++;
|
||||
}
|
||||
if (data[i] != '\0')
|
||||
tmp[j] = data[i];
|
||||
|
||||
pnext++;
|
||||
if (*pnext != '\0')
|
||||
{
|
||||
strtout = simple_strtoul (pnext , &ptmp, 16);
|
||||
sprintf(extra, "%s %d" ,extra ,strtout);
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
pch = pnext;
|
||||
}
|
||||
wrqu->length = 6;
|
||||
break;
|
||||
case 'd':
|
||||
// 4 bytes
|
||||
//*data = rtw_read32(padapter, addr);
|
||||
sprintf(data, "%08x", rtw_read32(padapter, addr));
|
||||
//add read data format blank
|
||||
for (i=0 ; i <= strlen(data) ; i++)
|
||||
{
|
||||
if (i%2==0)
|
||||
{
|
||||
tmp[j]=' ';
|
||||
j++;
|
||||
}
|
||||
if (data[i] != '\0')
|
||||
tmp[j] = data[i];
|
||||
|
||||
j++;
|
||||
}
|
||||
pch = tmp;
|
||||
DBG_88E("pch=%s",pch);
|
||||
|
||||
while (*pch != '\0')
|
||||
{
|
||||
pnext = strpbrk(pch, " ");
|
||||
if (!pnext)
|
||||
break;
|
||||
|
||||
pnext++;
|
||||
if (*pnext != '\0')
|
||||
{
|
||||
strtout = simple_strtoul (pnext , &ptmp, 16);
|
||||
sprintf(extra, "%s %d" ,extra ,strtout);
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
pch = pnext;
|
||||
}
|
||||
wrqu->length = strlen(extra);
|
||||
break;
|
||||
|
||||
default:
|
||||
wrqu->length = 0;
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
j++;
|
||||
}
|
||||
pch = tmp;
|
||||
DBG_88E("pch=%s",pch);
|
||||
|
||||
while (*pch != '\0') {
|
||||
pnext = strpbrk(pch, " ");
|
||||
if (!pnext)
|
||||
break;
|
||||
pnext++;
|
||||
if (*pnext != '\0') {
|
||||
strtout = simple_strtoul (pnext , &ptmp, 16);
|
||||
sprintf(extra, "%s %d" ,extra ,strtout);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
pch = pnext;
|
||||
}
|
||||
wrqu->length = strlen(extra);
|
||||
break;
|
||||
default:
|
||||
wrqu->length = 0;
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -9842,7 +9832,7 @@ static int rtw_mp_read_rf(struct net_device *dev,
|
|||
struct iw_request_info *info,
|
||||
struct iw_point *wrqu, char *extra)
|
||||
{
|
||||
char input[wrqu->length];
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
char *pch, *pnext, *ptmp;
|
||||
char data[20],tmp[20];
|
||||
//u32 *data = (u32*)extra;
|
||||
|
@ -9850,51 +9840,49 @@ static int rtw_mp_read_rf(struct net_device *dev,
|
|||
u32 ret,i=0 ,j=0,strtou=0;
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
|
||||
|
||||
if (wrqu->length > 128) return -EFAULT;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
|
||||
}
|
||||
ret = sscanf(input, "%d,%x", &path, &addr);
|
||||
if (ret < 2) return -EINVAL;
|
||||
kfree(input);
|
||||
if (ret < 2)
|
||||
return -EINVAL;
|
||||
|
||||
if (path >= MAX_RF_PATH_NUMS) return -EINVAL;
|
||||
if (addr > 0xFF) return -EINVAL;
|
||||
if (path >= MAX_RF_PATH_NUMS)
|
||||
return -EINVAL;
|
||||
if (addr > 0xFF)
|
||||
return -EINVAL;
|
||||
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
|
||||
//*data = read_rfreg(padapter, path, addr);
|
||||
sprintf(data, "%08x", read_rfreg(padapter, path, addr));
|
||||
//add read data format blank
|
||||
for (i=0 ; i <= strlen(data) ; i++)
|
||||
{
|
||||
if (i%2==0)
|
||||
{
|
||||
tmp[j]=' ';
|
||||
j++;
|
||||
}
|
||||
tmp[j] = data[i];
|
||||
j++;
|
||||
}
|
||||
pch = tmp;
|
||||
DBG_88E("pch=%s",pch);
|
||||
|
||||
while (*pch != '\0')
|
||||
{
|
||||
pnext = strpbrk(pch, " ");
|
||||
pnext++;
|
||||
if (*pnext != '\0')
|
||||
{
|
||||
strtou = simple_strtoul (pnext , &ptmp, 16);
|
||||
sprintf(extra, "%s %d" ,extra ,strtou);
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
pch = pnext;
|
||||
}
|
||||
wrqu->length = strlen(extra);
|
||||
//add read data format blank
|
||||
for (i=0 ; i <= strlen(data) ; i++) {
|
||||
if (i%2==0) {
|
||||
tmp[j]=' ';
|
||||
j++;
|
||||
}
|
||||
tmp[j] = data[i];
|
||||
j++;
|
||||
}
|
||||
pch = tmp;
|
||||
DBG_88E("pch=%s",pch);
|
||||
|
||||
while (*pch != '\0') {
|
||||
pnext = strpbrk(pch, " ");
|
||||
pnext++;
|
||||
if (*pnext != '\0') {
|
||||
strtou = simple_strtoul (pnext , &ptmp, 16);
|
||||
sprintf(extra, "%s %d" ,extra ,strtou);
|
||||
} else{
|
||||
break;
|
||||
}
|
||||
pch = pnext;
|
||||
}
|
||||
wrqu->length = strlen(extra);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -9964,24 +9952,25 @@ static int rtw_mp_rate(struct net_device *dev,
|
|||
struct iw_point *wrqu, char *extra)
|
||||
{
|
||||
u32 rate = MPT_RATE_1M;
|
||||
u8 input[wrqu->length];
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
rate = rtw_atoi(input);
|
||||
sprintf(extra, "Set data rate to %d" , rate);
|
||||
|
||||
kfree(input);
|
||||
if (rate <= 0x7f)
|
||||
rate = wifirate2_ratetbl_inx((u8)rate);
|
||||
else
|
||||
rate =(rate-0x80+MPT_RATE_MCS0);
|
||||
|
||||
//DBG_88E("%s: rate=%d\n", __func__, rate);
|
||||
|
||||
if (rate >= MPT_RATE_LAST)
|
||||
return -EINVAL;
|
||||
return -EINVAL;
|
||||
|
||||
padapter->mppriv.rateidx = rate;
|
||||
Hal_SetDataRate(padapter);
|
||||
|
@ -9996,20 +9985,23 @@ static int rtw_mp_channel(struct net_device *dev,
|
|||
{
|
||||
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
u8 input[wrqu->length];
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
u32 channel = 1;
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
channel = rtw_atoi(input);
|
||||
//DBG_88E("%s: channel=%d\n", __func__, channel);
|
||||
sprintf(extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel);
|
||||
|
||||
padapter->mppriv.channel = channel;
|
||||
Hal_SetChannel(padapter);
|
||||
|
||||
wrqu->length = strlen(extra) + 1;
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10045,16 +10037,16 @@ static int rtw_mp_txpower(struct net_device *dev,
|
|||
struct iw_point *wrqu, char *extra)
|
||||
{
|
||||
u32 idx_a=0,idx_b=0;
|
||||
u8 input[wrqu->length];
|
||||
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
sscanf(input,"patha=%d,pathb=%d",&idx_a,&idx_b);
|
||||
//DBG_88E("%s: tx_pwr_idx_a=%x b=%x\n", __func__, idx_a, idx_b);
|
||||
|
||||
sprintf(extra, "Set power level path_A:%d path_B:%d", idx_a , idx_b);
|
||||
padapter->mppriv.txpoweridx = (u8)idx_a;
|
||||
|
@ -10063,6 +10055,7 @@ static int rtw_mp_txpower(struct net_device *dev,
|
|||
Hal_SetAntennaPathPower(padapter);
|
||||
|
||||
wrqu->length = strlen(extra) + 1;
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10071,37 +10064,35 @@ static int rtw_mp_ant_tx(struct net_device *dev,
|
|||
struct iw_point *wrqu, char *extra)
|
||||
{
|
||||
u8 i;
|
||||
u8 input[wrqu->length];
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
u16 antenna = 0;
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
//DBG_88E("%s: input=%s\n", __func__, input);
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
sprintf(extra, "switch Tx antenna to %s", input);
|
||||
|
||||
for (i=0; i < strlen(input); i++)
|
||||
{
|
||||
switch (input[i])
|
||||
{
|
||||
case 'a' :
|
||||
antenna|=ANTENNA_A;
|
||||
break;
|
||||
case 'b':
|
||||
antenna|=ANTENNA_B;
|
||||
break;
|
||||
}
|
||||
for (i=0; i < strlen(input); i++) {
|
||||
switch (input[i]) {
|
||||
case 'a':
|
||||
antenna|=ANTENNA_A;
|
||||
break;
|
||||
case 'b':
|
||||
antenna|=ANTENNA_B;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//antenna |= BIT(extra[i]-'a');
|
||||
//DBG_88E("%s: antenna=0x%x\n", __func__, antenna);
|
||||
padapter->mppriv.antenna_tx = antenna;
|
||||
//DBG_88E("%s:mppriv.antenna_rx=%d\n", __func__, padapter->mppriv.antenna_tx);
|
||||
|
||||
Hal_SetAntenna(padapter);
|
||||
|
||||
wrqu->length = strlen(extra) + 1;
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10111,35 +10102,34 @@ static int rtw_mp_ant_rx(struct net_device *dev,
|
|||
{
|
||||
u8 i;
|
||||
u16 antenna = 0;
|
||||
u8 input[wrqu->length];
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
//DBG_88E("%s: input=%s\n", __func__, input);
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
|
||||
sprintf(extra, "switch Rx antenna to %s", input);
|
||||
|
||||
for (i=0; i < strlen(input); i++) {
|
||||
|
||||
switch (input[i])
|
||||
{
|
||||
case 'a' :
|
||||
antenna|=ANTENNA_A;
|
||||
break;
|
||||
case 'b':
|
||||
antenna|=ANTENNA_B;
|
||||
break;
|
||||
}
|
||||
switch (input[i]) {
|
||||
case 'a' :
|
||||
antenna|=ANTENNA_A;
|
||||
break;
|
||||
case 'b':
|
||||
antenna|=ANTENNA_B;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//DBG_88E("%s: antenna=0x%x\n", __func__, antenna);
|
||||
padapter->mppriv.antenna_rx = antenna;
|
||||
//DBG_88E("%s:mppriv.antenna_rx=%d\n", __func__, padapter->mppriv.antenna_rx);
|
||||
Hal_SetAntenna(padapter);
|
||||
wrqu->length = strlen(extra);
|
||||
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10163,7 +10153,7 @@ static int rtw_mp_ctx(struct net_device *dev,
|
|||
|
||||
DBG_88E("%s: in=%s\n", __func__, extra);
|
||||
|
||||
countPkTx = strncmp(extra, "count=", 5); // strncmp TRUE is 0
|
||||
countPkTx = strncmp(extra, "count=", 5); // strncmp true is 0
|
||||
cotuTx = strncmp(extra, "background", 20);
|
||||
CarrSprTx = strncmp(extra, "background,cs", 20);
|
||||
scTx = strncmp(extra, "background,sc", 20);
|
||||
|
@ -10296,32 +10286,29 @@ static int rtw_mp_arx(struct net_device *dev,
|
|||
{
|
||||
u8 bStartRx=0,bStopRx=0,bQueryPhy;
|
||||
u32 cckok=0,cckcrc=0,ofdmok=0,ofdmcrc=0,htok=0,htcrc=0,OFDM_FA=0,CCK_FA=0;
|
||||
u8 input[wrqu->length];
|
||||
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
DBG_88E("%s: %s\n", __func__, input);
|
||||
|
||||
bStartRx = (strncmp(input, "start", 5)==0)?1:0; // strncmp TRUE is 0
|
||||
bStopRx = (strncmp(input, "stop", 5)==0)?1:0; // strncmp TRUE is 0
|
||||
bQueryPhy = (strncmp(input, "phy", 3)==0)?1:0; // strncmp TRUE is 0
|
||||
bStartRx = (strncmp(input, "start", 5)==0)?1:0; // strncmp true is 0
|
||||
bStopRx = (strncmp(input, "stop", 5)==0)?1:0; // strncmp true is 0
|
||||
bQueryPhy = (strncmp(input, "phy", 3)==0)?1:0; // strncmp true is 0
|
||||
|
||||
if (bStartRx)
|
||||
{
|
||||
if (bStartRx) {
|
||||
sprintf(extra, "start");
|
||||
SetPacketRx(padapter, bStartRx);
|
||||
}
|
||||
else if (bStopRx)
|
||||
{
|
||||
} else if (bStopRx) {
|
||||
SetPacketRx(padapter, 0);
|
||||
sprintf(extra, "Received packet OK:%d CRC error:%d",padapter->mppriv.rx_pktcount,padapter->mppriv.rx_crcerrpktcount);
|
||||
}
|
||||
else if (bQueryPhy)
|
||||
{
|
||||
} else if (bQueryPhy) {
|
||||
/*
|
||||
OFDM FA
|
||||
RegCF0[15:0]
|
||||
|
@ -10350,7 +10337,8 @@ static int rtw_mp_arx(struct net_device *dev,
|
|||
|
||||
sprintf(extra, "Phy Received packet OK:%d CRC error:%d FA Counter: %d",cckok+ofdmok+htok,cckcrc+ofdmcrc+htcrc,OFDM_FA+CCK_FA);
|
||||
}
|
||||
wrqu->length = strlen(extra) + 1;
|
||||
wrqu->length = strlen(extra) + 1;
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10385,34 +10373,37 @@ static int rtw_mp_pwrtrk(struct net_device *dev,
|
|||
u32 thermal;
|
||||
s32 ret;
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
u8 input[wrqu->length];
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
|
||||
enable = 1;
|
||||
if (wrqu->length > 1) { // not empty string
|
||||
if (strncmp(input, "stop", 4) == 0)
|
||||
{
|
||||
if (strncmp(input, "stop", 4) == 0) {
|
||||
enable = 0;
|
||||
sprintf(extra, "mp tx power tracking stop");
|
||||
}
|
||||
else if (sscanf(input, "ther=%d", &thermal)) {
|
||||
} else if (sscanf(input, "ther=%d", &thermal)) {
|
||||
ret = Hal_SetThermalMeter(padapter, (u8)thermal);
|
||||
if (ret == _FAIL) return -EPERM;
|
||||
sprintf(extra, "mp tx power tracking start,target value=%d ok ",thermal);
|
||||
}else {
|
||||
return -EINVAL;
|
||||
} else {
|
||||
kfree(input);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
kfree(input);
|
||||
ret = Hal_SetPowerTracking(padapter, enable);
|
||||
if (ret == _FAIL) return -EPERM;
|
||||
if (ret == _FAIL)
|
||||
return -EPERM;
|
||||
|
||||
wrqu->length = strlen(extra);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10421,15 +10412,19 @@ static int rtw_mp_psd(struct net_device *dev,
|
|||
struct iw_point *wrqu, char *extra)
|
||||
{
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
u8 input[wrqu->length];
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
strcpy(extra,input);
|
||||
|
||||
wrqu->length = mp_query_psd(padapter, extra);
|
||||
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10459,7 +10454,7 @@ static int rtw_mp_thermal(struct net_device *dev,
|
|||
|
||||
//DBG_88E("print extra %s\n",extra);
|
||||
|
||||
bwrite = strncmp(extra, "write", 6); // strncmp TRUE is 0
|
||||
bwrite = strncmp(extra, "write", 6); // strncmp true is 0
|
||||
|
||||
Hal_GetThermalMeter(padapter, &val);
|
||||
|
||||
|
@ -10581,27 +10576,30 @@ static int rtw_mp_phypara(struct net_device *dev,
|
|||
{
|
||||
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
char input[wrqu->length];
|
||||
char *input = kmalloc(wrqu->length, GFP_KERNEL);
|
||||
u32 valxcap;
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length))
|
||||
return -EFAULT;
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
DBG_88E("%s:iwpriv in=%s\n", __func__, input);
|
||||
|
||||
sscanf(input, "xcap=%d", &valxcap);
|
||||
|
||||
kfree(input);
|
||||
if (!IS_HARDWARE_TYPE_8192D(padapter))
|
||||
return 0;
|
||||
return 0;
|
||||
#ifdef CONFIG_RTL8192D
|
||||
Hal_ProSetCrystalCap(padapter , valxcap);
|
||||
#endif
|
||||
|
||||
sprintf(extra, "Set xcap=%d",valxcap);
|
||||
wrqu->length = strlen(extra) + 1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_mp_SetRFPath(struct net_device *dev,
|
||||
|
@ -10609,27 +10607,29 @@ static int rtw_mp_SetRFPath(struct net_device *dev,
|
|||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
char input[wrqu->data.length];
|
||||
char *input = kmalloc(wrqu->data.length, GFP_KERNEL);
|
||||
u8 bMain=1,bTurnoff=1;
|
||||
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length))
|
||||
return -EFAULT;
|
||||
DBG_88E("%s:iwpriv in=%s\n", __func__, input);
|
||||
|
||||
bMain = strncmp(input, "1", 2); // strncmp TRUE is 0
|
||||
bTurnoff = strncmp(input, "0", 3); // strncmp TRUE is 0
|
||||
bMain = strncmp(input, "1", 2); // strncmp true is 0
|
||||
bTurnoff = strncmp(input, "0", 3); // strncmp true is 0
|
||||
|
||||
if (bMain==0)
|
||||
{
|
||||
MP_PHY_SetRFPathSwitch(padapter,true);
|
||||
DBG_88E("%s:PHY_SetRFPathSwitch=TRUE\n", __func__);
|
||||
DBG_88E("%s:PHY_SetRFPathSwitch=true\n", __func__);
|
||||
}
|
||||
else if (bTurnoff==0)
|
||||
{
|
||||
MP_PHY_SetRFPathSwitch(padapter,false);
|
||||
DBG_88E("%s:PHY_SetRFPathSwitch=FALSE\n", __func__);
|
||||
DBG_88E("%s:PHY_SetRFPathSwitch=false\n", __func__);
|
||||
}
|
||||
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10638,19 +10638,20 @@ static int rtw_mp_QueryDrv(struct net_device *dev,
|
|||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
PADAPTER padapter = rtw_netdev_priv(dev);
|
||||
char input[wrqu->data.length];
|
||||
char *input = kmalloc(wrqu->data.length, GFP_KERNEL);
|
||||
u8 qAutoLoad=1;
|
||||
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||
|
||||
if (!input)
|
||||
return -ENOMEM;
|
||||
|
||||
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length))
|
||||
return -EFAULT;
|
||||
DBG_88E("%s:iwpriv in=%s\n", __func__, input);
|
||||
|
||||
qAutoLoad = strncmp(input, "autoload", 8); // strncmp TRUE is 0
|
||||
qAutoLoad = strncmp(input, "autoload", 8); // strncmp true is 0
|
||||
|
||||
if (qAutoLoad==0)
|
||||
{
|
||||
if (qAutoLoad==0) {
|
||||
DBG_88E("%s:qAutoLoad\n", __func__);
|
||||
|
||||
if (pEEPROM->bautoload_fail_flag)
|
||||
|
@ -10658,7 +10659,8 @@ static int rtw_mp_QueryDrv(struct net_device *dev,
|
|||
else
|
||||
sprintf(extra, "ok");
|
||||
}
|
||||
wrqu->data.length = strlen(extra) + 1;
|
||||
wrqu->data.length = strlen(extra) + 1;
|
||||
kfree(input);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10698,7 +10700,7 @@ static int rtw_mp_SetBT(struct net_device *dev,
|
|||
|
||||
DBG_88E("%s:iwpriv in=%s\n", __func__, extra);
|
||||
ready = strncmp(extra, "ready", 5);
|
||||
testmode = strncmp(extra, "testmode", 8); // strncmp TRUE is 0
|
||||
testmode = strncmp(extra, "testmode", 8); // strncmp true is 0
|
||||
trxparam = strncmp(extra, "trxparam", 8);
|
||||
setgen = strncmp(extra, "setgen", 6);
|
||||
getgen = strncmp(extra, "getgen", 6);
|
||||
|
|
|
@ -426,11 +426,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
|
|||
break;
|
||||
case ANDROID_WIFI_CMD_RXFILTER_ADD:
|
||||
//int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0';
|
||||
//bytes_written = net_os_rxfilter_add_remove(net, TRUE, filter_num);
|
||||
//bytes_written = net_os_rxfilter_add_remove(net, true, filter_num);
|
||||
break;
|
||||
case ANDROID_WIFI_CMD_RXFILTER_REMOVE:
|
||||
//int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0';
|
||||
//bytes_written = net_os_rxfilter_add_remove(net, FALSE, filter_num);
|
||||
//bytes_written = net_os_rxfilter_add_remove(net, false, filter_num);
|
||||
break;
|
||||
|
||||
case ANDROID_WIFI_CMD_BTCOEXSCAN_START:
|
||||
|
|
|
@ -417,16 +417,16 @@ _func_enter_;
|
|||
} else if (purb->status == -ESHUTDOWN) {
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: ESHUTDOWN\n"));
|
||||
padapter->bDriverStopped=true;
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped=TRUE\n"));
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped=true\n"));
|
||||
|
||||
goto check_completion;
|
||||
}
|
||||
else
|
||||
{
|
||||
padapter->bSurpriseRemoved=true;
|
||||
DBG_88E("bSurpriseRemoved=TRUE\n");
|
||||
DBG_88E("bSurpriseRemoved=true\n");
|
||||
//rtl8192cu_trigger_gpio_0(padapter);
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bSurpriseRemoved=TRUE\n"));
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bSurpriseRemoved=true\n"));
|
||||
|
||||
goto check_completion;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue