2016-10-07 17:59:04

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 01/34] staging:r8188eu: remove rtw_os_recv_resource_alloc function

This simple function does not allocate any resource.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 3 +--
drivers/staging/rtl8188eu/include/recv_osdep.h | 2 --
drivers/staging/rtl8188eu/os_dep/recv_linux.c | 6 ------
3 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index b87cbbb..65ae11e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -83,8 +83,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
list_add_tail(&(precvframe->list),
&(precvpriv->free_recv_queue.queue));

- rtw_os_recv_resource_alloc(precvframe);
-
+ precvframe->pkt = NULL;
precvframe->len = 0;

precvframe->adapter = padapter;
diff --git a/drivers/staging/rtl8188eu/include/recv_osdep.h b/drivers/staging/rtl8188eu/include/recv_osdep.h
index 7550d58..9b43a13 100644
--- a/drivers/staging/rtl8188eu/include/recv_osdep.h
+++ b/drivers/staging/rtl8188eu/include/recv_osdep.h
@@ -29,8 +29,6 @@ int rtw_recv_indicatepkt(struct adapter *adapter,

void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup);

-void rtw_os_recv_resource_alloc(struct recv_frame *recvfr);
-
int rtw_os_recvbuf_resource_alloc(struct adapter *adapt, struct recv_buf *buf);

void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index 103cdb4..b85824e 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -21,12 +21,6 @@
#include <osdep_intf.h>
#include <usb_ops_linux.h>

-/* alloc os related resource in struct recv_frame */
-void rtw_os_recv_resource_alloc(struct recv_frame *precvframe)
-{
- precvframe->pkt = NULL;
-}
-
/* alloc os related resource in struct recv_buf */
int rtw_os_recvbuf_resource_alloc(struct adapter *padapter,
struct recv_buf *precvbuf)
--
2.7.3


2016-10-07 17:59:08

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 27/34] staging:r8188eu: remove pallocated_recv_buf member of the recv_priv structure

recv_priv used instead.
recv_priv does not changed after assigning
and it can be used as kfree argument

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 10 +++-------
drivers/staging/rtl8188eu/include/rtw_recv.h | 1 -
2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index d3d64fa..0fc093e 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -37,18 +37,14 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
/* init recv_buf */
_rtw_init_queue(&precvpriv->free_recv_buf_queue);

- precvpriv->pallocated_recv_buf =
+ precvpriv->precv_buf =
kcalloc(NR_RECVBUFF, sizeof(struct recv_buf), GFP_KERNEL);
- if (!precvpriv->pallocated_recv_buf) {
+ if (!precvpriv->precv_buf) {
res = _FAIL;
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
("alloc recv_buf fail!\n"));
goto exit;
}
-
- precvpriv->precv_buf = (struct recv_buf *)precvpriv->pallocated_recv_buf;
-
-
precvbuf = precvpriv->precv_buf;

for (i = 0; i < NR_RECVBUFF; i++) {
@@ -93,7 +89,7 @@ void rtw_hal_free_recv_priv(struct adapter *padapter)
precvbuf++;
}

- kfree(precvpriv->pallocated_recv_buf);
+ kfree(precvpriv->precv_buf);

if (skb_queue_len(&precvpriv->rx_skb_queue))
DBG_88E(KERN_WARNING "rx_skb_queue not empty\n");
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 8fa3b81..e95f4f2 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -180,7 +180,6 @@ struct recv_priv {
struct tasklet_struct recv_tasklet;
struct sk_buff_head free_recv_skb_queue;
struct sk_buff_head rx_skb_queue;
- u8 *pallocated_recv_buf;
struct recv_buf *precv_buf; /* 4 alignment */
struct __queue free_recv_buf_queue;
/* For display the phy informatiom */
--
2.7.3

2016-10-07 17:59:16

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 08/34] staging:r8188eu: remove ff_hwaddr member of recv_priv structure

Its value used instead.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/usb_halinit.c | 4 +---
drivers/staging/rtl8188eu/include/rtw_recv.h | 1 -
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 6 +++---
3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 95bbeca..dfb78bb 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -994,12 +994,10 @@ u32 rtw_hal_inirp_init(struct adapter *Adapter)
RT_TRACE(_module_hci_hal_init_c_, _drv_info_,
("===> usb_inirp_init\n"));

- precvpriv->ff_hwaddr = RECV_BULK_IN_ADDR;
-
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
- if (usb_read_port(Adapter, precvpriv->ff_hwaddr, precvbuf) == false) {
+ if (usb_read_port(Adapter, RECV_BULK_IN_ADDR, precvbuf) == false) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_port error\n"));
status = _FAIL;
goto exit;
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index c868863..e871ebb 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -174,7 +174,6 @@ struct recv_priv {
u64 rx_drop;
u64 last_rx_bytes;

- uint ff_hwaddr;
u8 rx_pending_cnt;

struct tasklet_struct irq_prepare_beacon_tasklet;
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 24d2250..175c1ae 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -403,7 +403,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n"));
precvbuf->reuse = true;
- usb_read_port(adapt, precvpriv->ff_hwaddr, precvbuf);
+ usb_read_port(adapt, RECV_BULK_IN_ADDR, precvbuf);
DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
} else {
skb_put(precvbuf->pskb, purb->actual_length);
@@ -414,7 +414,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)

precvbuf->pskb = NULL;
precvbuf->reuse = false;
- usb_read_port(adapt, precvpriv->ff_hwaddr, precvbuf);
+ usb_read_port(adapt, RECV_BULK_IN_ADDR, precvbuf);
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
@@ -437,7 +437,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
case -EOVERFLOW:
adapt->HalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL;
precvbuf->reuse = true;
- usb_read_port(adapt, precvpriv->ff_hwaddr, precvbuf);
+ usb_read_port(adapt, RECV_BULK_IN_ADDR, precvbuf);
break;
case -EINPROGRESS:
DBG_88E("ERROR: URB IS IN PROGRESS!\n");
--
2.7.3

2016-10-07 17:59:10

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 04/34] staging:r8188eu: remove free_recv_buf_queue_cnt member of recv_priv structure

This variable does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 1 -
drivers/staging/rtl8188eu/hal/usb_halinit.c | 1 -
drivers/staging/rtl8188eu/include/rtw_recv.h | 1 -
3 files changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index d0495a1..67a765a 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -58,7 +58,6 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
precvbuf->adapter = padapter;
precvbuf++;
}
- precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF;
skb_queue_head_init(&precvpriv->rx_skb_queue);
{
int i;
diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 7692ca4..a09c68f 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -1006,7 +1006,6 @@ u32 rtw_hal_inirp_init(struct adapter *Adapter)
}

precvbuf++;
- precvpriv->free_recv_buf_queue_cnt--;
}

exit:
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 49d9738..a8874a2 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -186,7 +186,6 @@ struct recv_priv {
u8 *pallocated_recv_buf;
u8 *precv_buf; /* 4 alignment */
struct __queue free_recv_buf_queue;
- u32 free_recv_buf_queue_cnt;
/* For display the phy informatiom */
u8 is_signal_dbg; /* for debug */
u8 signal_strength_dbg; /* for debug */
--
2.7.3

2016-10-07 17:59:06

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 02/34] staging:r8188eu: remove wrappers for rtw_hal_inirp_init function

There is no reason to use these wrappers.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/drv_types.h | 1 -
drivers/staging/rtl8188eu/os_dep/os_intfs.c | 6 ++----
drivers/staging/rtl8188eu/os_dep/usb_intf.c | 10 ----------
3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h
index 32326fd..5eb56b1 100644
--- a/drivers/staging/rtl8188eu/include/drv_types.h
+++ b/drivers/staging/rtl8188eu/include/drv_types.h
@@ -156,7 +156,6 @@ struct adapter {
u8 hw_init_completed;

void *cmdThread;
- void (*intf_start)(struct adapter *adapter);
void (*intf_stop)(struct adapter *adapter);
struct net_device *pnetdev;
struct net_device *pmondev;
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 40691f1..8d96e51 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -596,8 +596,7 @@ static int _netdev_open(struct net_device *pnetdev)
pr_info("can't init mlme_ext_priv\n");
goto netdev_open_error;
}
- if (padapter->intf_start)
- padapter->intf_start(padapter);
+ rtw_hal_inirp_init(padapter);

rtw_led_control(padapter, LED_CTL_NO_LINK);

@@ -658,8 +657,7 @@ static int ips_netdrv_open(struct adapter *padapter)
goto netdev_open_error;
}

- if (padapter->intf_start)
- padapter->intf_start(padapter);
+ rtw_hal_inirp_init(padapter);

rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
mod_timer(&padapter->mlmepriv.dynamic_chk_timer,
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 68e1e6b..4996332 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -141,15 +141,6 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)

}

-static void usb_intf_start(struct adapter *padapter)
-{
- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+usb_intf_start\n"));
-
- rtw_hal_inirp_init(padapter);
-
- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("-usb_intf_start\n"));
-}
-
static void usb_intf_stop(struct adapter *padapter)
{
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+usb_intf_stop\n"));
@@ -366,7 +357,6 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
if (!padapter->HalData)
DBG_88E("cant not alloc memory for HAL DATA\n");

- padapter->intf_start = &usb_intf_start;
padapter->intf_stop = &usb_intf_stop;

/* step read_chip_version */
--
2.7.3

2016-10-07 18:00:08

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 03/34] staging:r8188eu: remove pm_netdev_open function

netdev_open and ips_netdrv_open are used instead of pm_netdev_open.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 2 +-
drivers/staging/rtl8188eu/include/osdep_intf.h | 3 ++-
drivers/staging/rtl8188eu/os_dep/os_intfs.c | 16 ++--------------
drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +-
4 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
index 0b70fe7..fc6385b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
@@ -94,7 +94,7 @@ static int rtw_hw_resume(struct adapter *padapter)
pwrpriv->bips_processing = true;
rtw_reset_drv_sw(padapter);

- if (pm_netdev_open(pnetdev, false) != 0) {
+ if (ips_netdrv_open((struct adapter *)rtw_netdev_priv(pnetdev)) != _SUCCESS) {
mutex_unlock(&pwrpriv->mutex_lock);
goto error_exit;
}
diff --git a/drivers/staging/rtl8188eu/include/osdep_intf.h b/drivers/staging/rtl8188eu/include/osdep_intf.h
index dbd7dc4..97d3d85 100644
--- a/drivers/staging/rtl8188eu/include/osdep_intf.h
+++ b/drivers/staging/rtl8188eu/include/osdep_intf.h
@@ -35,7 +35,8 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
struct net_device *rtw_init_netdev(struct adapter *padapter);
u16 rtw_recv_select_queue(struct sk_buff *skb);

-int pm_netdev_open(struct net_device *pnetdev, u8 bnormal);
+int netdev_open(struct net_device *pnetdev);
+int ips_netdrv_open(struct adapter *padapter);
void rtw_ips_dev_unload(struct adapter *padapter);
int rtw_ips_pwr_up(struct adapter *padapter);
void rtw_ips_pwr_down(struct adapter *padapter);
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 8d96e51..2a1e63d 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -144,7 +144,6 @@ static bool rtw_monitor_enable;
module_param_named(monitor_enable, rtw_monitor_enable, bool, 0444);
MODULE_PARM_DESC(monitor_enable, "Enable monitor inferface (default: false)");

-static int netdev_open(struct net_device *pnetdev);
static int netdev_close(struct net_device *pnetdev);

static void loadparam(struct adapter *padapter, struct net_device *pnetdev)
@@ -629,7 +628,7 @@ netdev_open_error:
return -1;
}

-static int netdev_open(struct net_device *pnetdev)
+int netdev_open(struct net_device *pnetdev)
{
int ret;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
@@ -641,7 +640,7 @@ static int netdev_open(struct net_device *pnetdev)
return ret;
}

-static int ips_netdrv_open(struct adapter *padapter)
+int ips_netdrv_open(struct adapter *padapter)
{
int status = _SUCCESS;

@@ -718,17 +717,6 @@ void rtw_ips_dev_unload(struct adapter *padapter)
rtw_hal_deinit(padapter);
}

-int pm_netdev_open(struct net_device *pnetdev, u8 bnormal)
-{
- int status;
-
- if (bnormal)
- status = netdev_open(pnetdev);
- else
- status = (_SUCCESS == ips_netdrv_open((struct adapter *)rtw_netdev_priv(pnetdev))) ? (0) : (-1);
- return status;
-}
-
static int netdev_close(struct net_device *pnetdev)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 4996332..94dac53 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -285,7 +285,7 @@ static int rtw_resume_process(struct adapter *padapter)
pwrpriv->bkeepfwalive = false;

pr_debug("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive);
- if (pm_netdev_open(pnetdev, true) != 0) {
+ if (netdev_open(pnetdev) != 0) {
mutex_unlock(&pwrpriv->mutex_lock);
goto exit;
}
--
2.7.3

2016-10-07 18:00:30

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 25/34] staging:r8188eu: remove prhdr local variable from rtw_free_stainfo function

This variable is unnecessary.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index a71e252..941d1a0 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -310,7 +310,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
/* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
for (i = 0; i < 16; i++) {
struct list_head *phead, *plist;
- struct recv_frame *prhdr;
struct recv_frame *prframe;
struct __queue *ppending_recvframe_queue;
struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
@@ -327,8 +326,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
plist = phead->next;

while (!list_empty(phead)) {
- prhdr = container_of(plist, struct recv_frame, list);
- prframe = (struct recv_frame *)prhdr;
+ prframe = container_of(plist, struct recv_frame, list);

plist = plist->next;

--
2.7.3

2016-10-07 18:00:41

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 32/34] staging:r8188eu: change poiter type from u8 to void for pallocated_frame_buf member of recv_priv structure

pallocated_frame_buf used only to preserve pointer for vfree function.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index a1b30a5..3e6edb6 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -71,7 +71,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
if (!precvpriv->pallocated_frame_buf)
return _FAIL;

- precvframe = (struct recv_frame *)PTR_ALIGN(precvpriv->pallocated_frame_buf, RXFRAME_ALIGN_SZ);
+ precvframe = PTR_ALIGN(precvpriv->pallocated_frame_buf, RXFRAME_ALIGN_SZ);

for (i = 0; i < NR_RECVFRAME; i++) {
INIT_LIST_HEAD(&(precvframe->list));
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 979961d..052af7b 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -164,7 +164,7 @@ struct recv_priv {
struct __queue free_recv_queue;
struct __queue recv_pending_queue;
struct __queue uc_swdec_pending_queue;
- u8 *pallocated_frame_buf;
+ void *pallocated_frame_buf;
struct adapter *adapter;
u32 bIsAnyNonBEPkts;
u64 rx_bytes;
--
2.7.3

2016-10-07 18:00:48

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 23/34] staging:r8188eu: remove padapter and free_sz arguments of rtw_os_xmit_resource_free function

These argumets does not used by rtw_os_xmit_resource_free function.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_xmit.c | 5 ++---
drivers/staging/rtl8188eu/include/xmit_osdep.h | 3 +--
drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 3 +--
3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index ca65f00..b60b126 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -220,7 +220,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
struct adapter *padapter = pxmitpriv->adapter;
struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitpriv->pxmit_frame_buf;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
- u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;

if (pxmitpriv->pxmit_frame_buf == NULL)
@@ -233,7 +232,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
}

for (i = 0; i < NR_XMITBUFF; i++) {
- rtw_os_xmit_resource_free(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
+ rtw_os_xmit_resource_free(pxmitbuf);
pxmitbuf++;
}

@@ -243,7 +242,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
/* free xmit extension buff */
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
for (i = 0; i < num_xmit_extbuf; i++) {
- rtw_os_xmit_resource_free(padapter, pxmitbuf, (max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
+ rtw_os_xmit_resource_free(pxmitbuf);
pxmitbuf++;
}

diff --git a/drivers/staging/rtl8188eu/include/xmit_osdep.h b/drivers/staging/rtl8188eu/include/xmit_osdep.h
index f9b3841..959ef4b 100644
--- a/drivers/staging/rtl8188eu/include/xmit_osdep.h
+++ b/drivers/staging/rtl8188eu/include/xmit_osdep.h
@@ -41,8 +41,7 @@ void rtw_os_xmit_schedule(struct adapter *padapter);

int rtw_os_xmit_resource_alloc(struct adapter *padapter,
struct xmit_buf *pxmitbuf, u32 alloc_sz);
-void rtw_os_xmit_resource_free(struct adapter *padapter,
- struct xmit_buf *pxmitbuf, u32 free_sz);
+void rtw_os_xmit_resource_free(struct xmit_buf *pxmitbuf);

uint rtw_remainder_len(struct pkt_file *pfile);
void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile);
diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
index 019ded9..e097c61 100644
--- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
@@ -80,8 +80,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
return _SUCCESS;
}

-void rtw_os_xmit_resource_free(struct adapter *padapter,
- struct xmit_buf *pxmitbuf, u32 free_sz)
+void rtw_os_xmit_resource_free(struct xmit_buf *pxmitbuf)
{
int i;

--
2.7.3

2016-10-07 18:00:58

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 22/34] staging:r8188eu: remove rtw_endofpktfile function

rtw_endofpktfile is one-line function.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +-
drivers/staging/rtl8188eu/include/xmit_osdep.h | 1 -
drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 5 -----
3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 2b641f5..ca65f00 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -1064,7 +1064,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct

frg_inx++;

- if (bmcst || rtw_endofpktfile(&pktfile)) {
+ if (bmcst || pktfile.pkt_len == 0) {
pattrib->nr_frags = frg_inx;

pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags == 1) ? llc_sz : 0) +
diff --git a/drivers/staging/rtl8188eu/include/xmit_osdep.h b/drivers/staging/rtl8188eu/include/xmit_osdep.h
index f96ca6a..f9b3841 100644
--- a/drivers/staging/rtl8188eu/include/xmit_osdep.h
+++ b/drivers/staging/rtl8188eu/include/xmit_osdep.h
@@ -47,7 +47,6 @@ void rtw_os_xmit_resource_free(struct adapter *padapter,
uint rtw_remainder_len(struct pkt_file *pfile);
void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile);
uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen);
-int rtw_endofpktfile(struct pkt_file *pfile);

void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt);
void rtw_os_xmit_complete(struct adapter *padapter,
diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
index 4b1b04e..019ded9 100644
--- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
@@ -59,11 +59,6 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
return len;
}

-int rtw_endofpktfile(struct pkt_file *pfile)
-{
- return pfile->pkt_len == 0;
-}
-
int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz)
{
int i;
--
2.7.3

2016-10-07 18:01:22

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 07/34] staging:r8188eu: remove (u32 cnt) argument of usb_read_port function

This argument does not used by usb_read_port function.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/usb_halinit.c | 2 +-
drivers/staging/rtl8188eu/include/usb_ops_linux.h | 2 +-
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 4d0e3f9..95bbeca 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -999,7 +999,7 @@ u32 rtw_hal_inirp_init(struct adapter *Adapter)
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
- if (usb_read_port(Adapter, precvpriv->ff_hwaddr, 0, precvbuf) == false) {
+ if (usb_read_port(Adapter, precvpriv->ff_hwaddr, precvbuf) == false) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_port error\n"));
status = _FAIL;
goto exit;
diff --git a/drivers/staging/rtl8188eu/include/usb_ops_linux.h b/drivers/staging/rtl8188eu/include/usb_ops_linux.h
index 4fc2e2d..fb586365 100644
--- a/drivers/staging/rtl8188eu/include/usb_ops_linux.h
+++ b/drivers/staging/rtl8188eu/include/usb_ops_linux.h
@@ -53,7 +53,7 @@ u8 usb_read8(struct adapter *adapter, u32 addr);
u16 usb_read16(struct adapter *adapter, u32 addr);
u32 usb_read32(struct adapter *adapter, u32 addr);

-u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, struct recv_buf *precvbuf);
+u32 usb_read_port(struct adapter *adapter, u32 addr, struct recv_buf *precvbuf);
void usb_read_port_cancel(struct adapter *adapter);

int usb_write8(struct adapter *adapter, u32 addr, u8 val);
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 22777b1..24d2250 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -403,7 +403,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n"));
precvbuf->reuse = true;
- usb_read_port(adapt, precvpriv->ff_hwaddr, 0, precvbuf);
+ usb_read_port(adapt, precvpriv->ff_hwaddr, precvbuf);
DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
} else {
skb_put(precvbuf->pskb, purb->actual_length);
@@ -414,7 +414,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)

precvbuf->pskb = NULL;
precvbuf->reuse = false;
- usb_read_port(adapt, precvpriv->ff_hwaddr, 0, precvbuf);
+ usb_read_port(adapt, precvpriv->ff_hwaddr, precvbuf);
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
@@ -437,7 +437,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
case -EOVERFLOW:
adapt->HalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL;
precvbuf->reuse = true;
- usb_read_port(adapt, precvpriv->ff_hwaddr, 0, precvbuf);
+ usb_read_port(adapt, precvpriv->ff_hwaddr, precvbuf);
break;
case -EINPROGRESS:
DBG_88E("ERROR: URB IS IN PROGRESS!\n");
@@ -448,7 +448,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
}
}

-u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, struct recv_buf *precvbuf)
+u32 usb_read_port(struct adapter *adapter, u32 addr, struct recv_buf *precvbuf)
{
struct urb *purb = NULL;
struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
--
2.7.3

2016-10-07 18:01:30

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 29/34] staging:r8188eu: remove free_recvframe_cnt member of recv_priv structure

Value of free_recvframe_cnt does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 33 ++--------------------------
drivers/staging/rtl8188eu/include/rtw_recv.h | 1 -
2 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 1b544e6..b5aeb8d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -66,8 +66,6 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)

precvpriv->adapter = padapter;

- precvpriv->free_recvframe_cnt = NR_RECVFRAME;
-
precvpriv->pallocated_frame_buf = vzalloc(NR_RECVFRAME * sizeof(struct recv_frame) + RXFRAME_ALIGN_SZ);

if (!precvpriv->pallocated_frame_buf)
@@ -119,20 +117,11 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv)
struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
{
struct recv_frame *hdr;
- struct adapter *padapter;
- struct recv_priv *precvpriv;

hdr = list_first_entry_or_null(&pfree_recv_queue->queue,
struct recv_frame, list);
- if (hdr) {
+ if (hdr)
list_del_init(&hdr->list);
- padapter = hdr->adapter;
- if (padapter) {
- precvpriv = &padapter->recvpriv;
- if (pfree_recv_queue == &precvpriv->free_recv_queue)
- precvpriv->free_recvframe_cnt--;
- }
- }

return hdr;
}
@@ -153,13 +142,8 @@ struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
int rtw_free_recvframe(struct recv_frame *precvframe,
struct __queue *pfree_recv_queue)
{
- struct adapter *padapter;
- struct recv_priv *precvpriv;
-
if (!precvframe)
return _FAIL;
- padapter = precvframe->adapter;
- precvpriv = &padapter->recvpriv;
if (precvframe->pkt) {
dev_kfree_skb_any(precvframe->pkt);/* free skb by driver */
precvframe->pkt = NULL;
@@ -173,29 +157,16 @@ int rtw_free_recvframe(struct recv_frame *precvframe,

list_add_tail(&(precvframe->list), get_list_head(pfree_recv_queue));

- if (padapter != NULL) {
- if (pfree_recv_queue == &precvpriv->free_recv_queue)
- precvpriv->free_recvframe_cnt++;
- }
-
- spin_unlock_bh(&pfree_recv_queue->lock);
+ spin_unlock_bh(&pfree_recv_queue->lock);

return _SUCCESS;
}

int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue)
{
- struct adapter *padapter = precvframe->adapter;
- struct recv_priv *precvpriv = &padapter->recvpriv;
-
list_del_init(&(precvframe->list));
list_add_tail(&(precvframe->list), get_list_head(queue));

- if (padapter != NULL) {
- if (queue == &precvpriv->free_recv_queue)
- precvpriv->free_recvframe_cnt++;
- }
-
return _SUCCESS;
}

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index e95f4f2..40f9728 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -166,7 +166,6 @@ struct recv_priv {
struct __queue uc_swdec_pending_queue;
u8 *pallocated_frame_buf;
u8 *precv_frame_buf;
- uint free_recvframe_cnt;
struct adapter *adapter;
u32 bIsAnyNonBEPkts;
u64 rx_bytes;
--
2.7.3

2016-10-07 18:01:41

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 19/34] staging:r8188eu: refactor rtl88eu_dm_txpower_tracking_callback_thermalmeter function

Remove is2t and rf local variables from this function.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/phy.c | 34 +++++++---------------------------
1 file changed, 7 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 8e0e685..126547e 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -393,9 +393,8 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
s8 ofdm_index[2], cck_index = 0;
s8 ofdm_index_old[2] = {0, 0}, cck_index_old = 0;
u32 i = 0, j = 0;
- bool is2t = false;

- u8 ofdm_min_index = 6, rf; /* OFDM BB Swing should be less than +3.0dB */
+ u8 ofdm_min_index = 6; /* OFDM BB Swing should be less than +3.0dB */
s8 ofdm_index_mapping[2][index_mapping_NUM_88E] = {
/* 2.4G, decrease power */
{0, 0, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10, 11},
@@ -420,11 +419,6 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
thermal_val = (u8)rtw_hal_read_rfreg(adapt, RF_PATH_A,
RF_T_METER_88E, 0xfc00);

- if (is2t)
- rf = 2;
- else
- rf = 1;
-
if (thermal_val) {
/* Query OFDM path A default setting */
ele_d = phy_query_bb_reg(adapt, rOFDM0_XATxIQImbalance, bMaskDWord)&bMaskOFDM_D;
@@ -436,17 +430,6 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
}
}

- /* Query OFDM path B default setting */
- if (is2t) {
- ele_d = phy_query_bb_reg(adapt, rOFDM0_XBTxIQImbalance, bMaskDWord)&bMaskOFDM_D;
- for (i = 0; i < OFDM_TABLE_SIZE_92D; i++) {
- if (ele_d == (OFDMSwingTable[i]&bMaskOFDM_D)) {
- ofdm_index_old[1] = (u8)i;
- break;
- }
- }
- }
-
/* Query CCK default setting From 0xa24 */
temp_cck = dm_odm->RFCalibrateInfo.RegA24;

@@ -465,8 +448,7 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
dm_odm->RFCalibrateInfo.ThermalValue_LCK = thermal_val;
dm_odm->RFCalibrateInfo.ThermalValue_IQK = thermal_val;

- for (i = 0; i < rf; i++)
- dm_odm->RFCalibrateInfo.OFDM_index[i] = ofdm_index_old[i];
+ dm_odm->RFCalibrateInfo.OFDM_index[0] = ofdm_index_old[0];
dm_odm->RFCalibrateInfo.CCK_index = cck_index_old;
}

@@ -525,13 +507,11 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
offset = index_mapping_NUM_88E-1;

/* Updating ofdm_index values with new OFDM / CCK offset */
- for (i = 0; i < rf; i++) {
- ofdm_index[i] = dm_odm->RFCalibrateInfo.OFDM_index[i] + ofdm_index_mapping[j][offset];
- if (ofdm_index[i] > OFDM_TABLE_SIZE_92D-1)
- ofdm_index[i] = OFDM_TABLE_SIZE_92D-1;
- else if (ofdm_index[i] < ofdm_min_index)
- ofdm_index[i] = ofdm_min_index;
- }
+ ofdm_index[0] = dm_odm->RFCalibrateInfo.OFDM_index[0] + ofdm_index_mapping[j][offset];
+ if (ofdm_index[0] > OFDM_TABLE_SIZE_92D-1)
+ ofdm_index[0] = OFDM_TABLE_SIZE_92D-1;
+ else if (ofdm_index[0] < ofdm_min_index)
+ ofdm_index[0] = ofdm_min_index;

cck_index = dm_odm->RFCalibrateInfo.CCK_index + ofdm_index_mapping[j][offset];
if (cck_index > CCK_TABLE_SIZE-1)
--
2.7.3

2016-10-07 18:01:50

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 18/34] staging:r8188eu: remove NumTotalRFPath member of hal_data_8188e structure

NumTotalRFPath is 1 for r8188eu chip.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/phy.c | 11 ++--
drivers/staging/rtl8188eu/hal/rf.c | 20 +++----
drivers/staging/rtl8188eu/hal/rf_cfg.c | 70 ++++-------------------
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 51 ++++++++---------
drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 3 -
5 files changed, 49 insertions(+), 106 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 84ffc01..8e0e685 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -278,7 +278,6 @@ void rtw_hal_set_bwmode(struct adapter *adapt, enum ht_channel_width bandwidth,

static void phy_sw_chnl_callback(struct adapter *adapt, u8 channel)
{
- u8 rf_path;
u32 param1, param2;
struct hal_data_8188e *hal_data = adapt->HalData;

@@ -286,12 +285,10 @@ static void phy_sw_chnl_callback(struct adapter *adapt, u8 channel)

param1 = RF_CHNLBW;
param2 = channel;
- for (rf_path = 0; rf_path < hal_data->NumTotalRFPath; rf_path++) {
- hal_data->RfRegChnlVal[rf_path] = (hal_data->RfRegChnlVal[rf_path] &
- 0xfffffc00) | param2;
- phy_set_rf_reg(adapt, (enum rf_radio_path)rf_path, param1,
- bRFRegOffsetMask, hal_data->RfRegChnlVal[rf_path]);
- }
+ hal_data->RfRegChnlVal[0] = (hal_data->RfRegChnlVal[0] &
+ 0xfffffc00) | param2;
+ phy_set_rf_reg(adapt, 0, param1,
+ bRFRegOffsetMask, hal_data->RfRegChnlVal[0]);
}

void rtw_hal_set_chan(struct adapter *adapt, u8 channel)
diff --git a/drivers/staging/rtl8188eu/hal/rf.c b/drivers/staging/rtl8188eu/hal/rf.c
index eddd075..8f8c9de 100644
--- a/drivers/staging/rtl8188eu/hal/rf.c
+++ b/drivers/staging/rtl8188eu/hal/rf.c
@@ -137,17 +137,15 @@ static void getpowerbase88e(struct adapter *adapt, u8 *pwr_level_ofdm,
(powerbase0<<8) | powerbase0;
*(ofdmbase+i) = powerbase0;
}
- for (i = 0; i < adapt->HalData->NumTotalRFPath; i++) {
- /* Check HT20 to HT40 diff */
- if (adapt->HalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
- powerlevel[i] = pwr_level_bw20[i];
- else
- powerlevel[i] = pwr_level_bw40[i];
- powerbase1 = powerlevel[i];
- powerbase1 = (powerbase1<<24) | (powerbase1<<16) |
- (powerbase1<<8) | powerbase1;
- *(mcs_base+i) = powerbase1;
- }
+ /* Check HT20 to HT40 diff */
+ if (adapt->HalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
+ powerlevel[0] = pwr_level_bw20[0];
+ else
+ powerlevel[0] = pwr_level_bw40[0];
+ powerbase1 = powerlevel[0];
+ powerbase1 = (powerbase1<<24) | (powerbase1<<16) |
+ (powerbase1<<8) | powerbase1;
+ *mcs_base = powerbase1;
}
static void get_rx_power_val_by_reg(struct adapter *adapt, u8 channel,
u8 index, u32 *powerbase0, u32 *powerbase1,
diff --git a/drivers/staging/rtl8188eu/hal/rf_cfg.c b/drivers/staging/rtl8188eu/hal/rf_cfg.c
index dde6441..9712d7b 100644
--- a/drivers/staging/rtl8188eu/hal/rf_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/rf_cfg.c
@@ -230,79 +230,33 @@ static bool rf6052_conf_para(struct adapter *adapt)
{
struct hal_data_8188e *hal_data = adapt->HalData;
u32 u4val = 0;
- u8 rfpath;
bool rtstatus = true;
struct bb_reg_def *pphyreg;

- for (rfpath = 0; rfpath < hal_data->NumTotalRFPath; rfpath++) {
- pphyreg = &hal_data->PHYRegDef[rfpath];
+ pphyreg = &hal_data->PHYRegDef[RF90_PATH_A];
+ u4val = phy_query_bb_reg(adapt, pphyreg->rfintfs, BRFSI_RFENV);

- switch (rfpath) {
- case RF90_PATH_A:
- case RF90_PATH_C:
- u4val = phy_query_bb_reg(adapt, pphyreg->rfintfs,
- BRFSI_RFENV);
- break;
- case RF90_PATH_B:
- case RF90_PATH_D:
- u4val = phy_query_bb_reg(adapt, pphyreg->rfintfs,
- BRFSI_RFENV << 16);
- break;
- }
+ phy_set_bb_reg(adapt, pphyreg->rfintfe, BRFSI_RFENV << 16, 0x1);
+ udelay(1);

- phy_set_bb_reg(adapt, pphyreg->rfintfe, BRFSI_RFENV << 16, 0x1);
- udelay(1);
+ phy_set_bb_reg(adapt, pphyreg->rfintfo, BRFSI_RFENV, 0x1);
+ udelay(1);

- phy_set_bb_reg(adapt, pphyreg->rfintfo, BRFSI_RFENV, 0x1);
- udelay(1);
+ phy_set_bb_reg(adapt, pphyreg->rfHSSIPara2, B3WIREADDREAALENGTH, 0x0);
+ udelay(1);

- phy_set_bb_reg(adapt, pphyreg->rfHSSIPara2,
- B3WIREADDREAALENGTH, 0x0);
- udelay(1);
+ phy_set_bb_reg(adapt, pphyreg->rfHSSIPara2, B3WIREDATALENGTH, 0x0);
+ udelay(1);

- phy_set_bb_reg(adapt, pphyreg->rfHSSIPara2,
- B3WIREDATALENGTH, 0x0);
- udelay(1);
+ rtstatus = rtl88e_phy_config_rf_with_headerfile(adapt);

- switch (rfpath) {
- case RF90_PATH_A:
- rtstatus = rtl88e_phy_config_rf_with_headerfile(adapt);
- break;
- case RF90_PATH_B:
- rtstatus = rtl88e_phy_config_rf_with_headerfile(adapt);
- break;
- case RF90_PATH_C:
- break;
- case RF90_PATH_D:
- break;
- }
-
- switch (rfpath) {
- case RF90_PATH_A:
- case RF90_PATH_C:
- phy_set_bb_reg(adapt, pphyreg->rfintfs,
- BRFSI_RFENV, u4val);
- break;
- case RF90_PATH_B:
- case RF90_PATH_D:
- phy_set_bb_reg(adapt, pphyreg->rfintfs,
- BRFSI_RFENV << 16, u4val);
- break;
- }
-
- if (!rtstatus)
- return false;
- }
+ phy_set_bb_reg(adapt, pphyreg->rfintfs, BRFSI_RFENV, u4val);

return rtstatus;
}

static bool rtl88e_phy_rf6052_config(struct adapter *adapt)
{
- struct hal_data_8188e *hal_data = adapt->HalData;
-
- hal_data->NumTotalRFPath = 1;
-
return rf6052_conf_para(adapt);
}

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index 385bc2f..edc6b52 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -135,7 +135,6 @@ void rtw_hal_read_chip_version(struct adapter *padapter)
dump_chip_info(ChipVersion);

pHalData->VersionID = ChipVersion;
- pHalData->NumTotalRFPath = 1;
}

void rtw_hal_set_odm_var(struct adapter *Adapter, enum hal_odm_variable eVariable, void *pValue1, bool bSet)
@@ -470,7 +469,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
{
struct hal_data_8188e *pHalData = padapter->HalData;
struct txpowerinfo24g pwrInfo24G;
- u8 rfPath, ch, group;
+ u8 ch, group;
u8 bIn24G, TxCount;

Hal_ReadPowerValueFromPROM_8188E(&pwrInfo24G, PROMContent, AutoLoadFail);
@@ -478,34 +477,32 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
if (!AutoLoadFail)
pHalData->bTXPowerDataReadFromEEPORM = true;

- for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
- for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
- bIn24G = Hal_GetChnlGroup88E(ch, &group);
- if (bIn24G) {
- pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
- if (ch == 14)
- pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
- else
- pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
- }
- if (bIn24G) {
- DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
- DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch , pHalData->Index24G_CCK_Base[rfPath][ch]);
- DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch , pHalData->Index24G_BW40_Base[rfPath][ch]);
- }
+ for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
+ bIn24G = Hal_GetChnlGroup88E(ch, &group);
+ if (bIn24G) {
+ pHalData->Index24G_CCK_Base[0][ch] = pwrInfo24G.IndexCCK_Base[0][group];
+ if (ch == 14)
+ pHalData->Index24G_BW40_Base[0][ch] = pwrInfo24G.IndexBW40_Base[0][4];
+ else
+ pHalData->Index24G_BW40_Base[0][ch] = pwrInfo24G.IndexBW40_Base[0][group];
}
- for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
- pHalData->CCK_24G_Diff[rfPath][TxCount] = pwrInfo24G.CCK_Diff[rfPath][TxCount];
- pHalData->OFDM_24G_Diff[rfPath][TxCount] = pwrInfo24G.OFDM_Diff[rfPath][TxCount];
- pHalData->BW20_24G_Diff[rfPath][TxCount] = pwrInfo24G.BW20_Diff[rfPath][TxCount];
- pHalData->BW40_24G_Diff[rfPath][TxCount] = pwrInfo24G.BW40_Diff[rfPath][TxCount];
- DBG_88E("======= TxCount %d =======\n", TxCount);
- DBG_88E("CCK_24G_Diff[%d][%d] = %d\n", rfPath, TxCount, pHalData->CCK_24G_Diff[rfPath][TxCount]);
- DBG_88E("OFDM_24G_Diff[%d][%d] = %d\n", rfPath, TxCount, pHalData->OFDM_24G_Diff[rfPath][TxCount]);
- DBG_88E("BW20_24G_Diff[%d][%d] = %d\n", rfPath, TxCount, pHalData->BW20_24G_Diff[rfPath][TxCount]);
- DBG_88E("BW40_24G_Diff[%d][%d] = %d\n", rfPath, TxCount, pHalData->BW40_24G_Diff[rfPath][TxCount]);
+ if (bIn24G) {
+ DBG_88E("======= Path %d, Channel %d =======\n", 0, ch);
+ DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", 0, ch , pHalData->Index24G_CCK_Base[0][ch]);
+ DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", 0, ch , pHalData->Index24G_BW40_Base[0][ch]);
}
}
+ for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
+ pHalData->CCK_24G_Diff[0][TxCount] = pwrInfo24G.CCK_Diff[0][TxCount];
+ pHalData->OFDM_24G_Diff[0][TxCount] = pwrInfo24G.OFDM_Diff[0][TxCount];
+ pHalData->BW20_24G_Diff[0][TxCount] = pwrInfo24G.BW20_Diff[0][TxCount];
+ pHalData->BW40_24G_Diff[0][TxCount] = pwrInfo24G.BW40_Diff[0][TxCount];
+ DBG_88E("======= TxCount %d =======\n", TxCount);
+ DBG_88E("CCK_24G_Diff[%d][%d] = %d\n", 0, TxCount, pHalData->CCK_24G_Diff[0][TxCount]);
+ DBG_88E("OFDM_24G_Diff[%d][%d] = %d\n", 0, TxCount, pHalData->OFDM_24G_Diff[0][TxCount]);
+ DBG_88E("BW20_24G_Diff[%d][%d] = %d\n", 0, TxCount, pHalData->BW20_24G_Diff[0][TxCount]);
+ DBG_88E("BW40_24G_Diff[%d][%d] = %d\n", 0, TxCount, pHalData->BW40_24G_Diff[0][TxCount]);
+ }

/* 2010/10/19 MH Add Regulator recognize for CU. */
if (!AutoLoadFail) {
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index 226e89b..9330361 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -200,9 +200,6 @@ struct hal_data_8188e {

u16 BasicRateSet;

- /* rf_ctrl */
- u8 NumTotalRFPath;
-
u8 BoardType;

/* EEPROM setting. */
--
2.7.3

2016-10-07 18:02:00

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 34/34] staging:r8188eu: remove unnecessary type cast for update_recvframe_phyinfo_88e argument

pphy_status alreay is (struct phy_stat *).

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index cc52082..34198fe 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -167,7 +167,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
}
if (pattrib->pkt_rpt_type == NORMAL_RX) { /* Normal rx packet */
if (pattrib->physt)
- update_recvframe_phyinfo_88e(precvframe, (struct phy_stat *)pphy_status);
+ update_recvframe_phyinfo_88e(precvframe, pphy_status);
if (rtw_recv_entry(precvframe) != _SUCCESS) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
--
2.7.3

2016-10-07 18:02:12

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 14/34] staging:r8188eu: remove unused members of hal_data_8188e structure

These members of hal_data_8188e structure does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/usb_halinit.c | 3 ---
drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 13 -------------
2 files changed, 16 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index dfb78bb..b1740cf 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -562,9 +562,6 @@ static void InitUsbAggregationSetting(struct adapter *Adapter)

/* Rx aggregation setting */
usb_AggSettingRxUpdate(Adapter);
-
- /* 201/12/10 MH Add for USB agg mode dynamic switch. */
- Adapter->HalData->UsbRxHighSpeedMode = false;
}

static void _InitBeaconParameters(struct adapter *Adapter)
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index 942ce91..53c975a 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -265,11 +265,6 @@ struct hal_data_8188e {
u32 CCKTxPowerLevelOriginalOffset;

u8 CrystalCap;
- u32 AntennaTxPath; /* Antenna path Tx */
- u32 AntennaRxPath; /* Antenna path Rx */
- u8 BluetoothCoexist;
-
- u8 b1x1RecvCombine; /* for 1T1R receive combining */

u32 AcParam_BE; /* Original parameter for BE, use for EDCA turbo. */

@@ -313,14 +308,6 @@ struct hal_data_8188e {
u8 OutEpQueueSel;
u8 OutEpNumber;

- /* Add for USB aggreation mode dynamic shceme. */
- bool UsbRxHighSpeedMode;
-
- /* 2010/11/22 MH Add for slim combo debug mode selective. */
- /* This is used for fix the drawback of CU TSMC-A/UMC-A cut.
- * HW auto suspend ability. Close BT clock. */
- bool SlimComboDbg;
-
u16 EfuseUsedBytes;

/* Auto FSM to Turn On, include clock, isolation, power control
--
2.7.3

2016-10-07 18:02:23

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 24/34] staging:r8188eu: remove unused function declerations

rtl8188eu_recv_hdl and rtl8188e_query_rx_phy_status doesn't used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/rtl8188e_recv.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_recv.h b/drivers/staging/rtl8188eu/include/rtl8188e_recv.h
index 80832a5..0d8bf51 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_recv.h
@@ -51,9 +51,7 @@ enum rx_packet_type {
};

#define INTERRUPT_MSG_FORMAT_LEN 60
-void rtl8188eu_recv_hdl(struct adapter *padapter, struct recv_buf *precvbuf);
void rtl8188eu_recv_tasklet(void *priv);
-void rtl8188e_query_rx_phy_status(struct recv_frame *fr, struct phy_stat *phy);
void rtl8188e_process_phy_info(struct adapter *padapter,
struct recv_frame *prframe);
void update_recvframe_phyinfo_88e(struct recv_frame *fra, struct phy_stat *phy);
--
2.7.3

2016-10-07 18:02:34

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 33/34] staging:r8188eu: refactor recvbuf2recvframe function

Reduce number of nesting levels.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 31 ++++++++++++------------
1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 9347dcd..cc52082 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -172,22 +172,21 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
}
- } else {
- /* enqueue recvframe to txrtp queue */
- if (pattrib->pkt_rpt_type == TX_REPORT1) {
- /* CCX-TXRPT ack for xmit mgmt frames. */
- handle_txrpt_ccx_88e(adapt, precvframe->rx_data);
- } else if (pattrib->pkt_rpt_type == TX_REPORT2) {
- ODM_RA_TxRPT2Handle_8188E(
- &haldata->odmpriv,
- precvframe->rx_data,
- pattrib->pkt_len,
- pattrib->MacIDValidEntry[0],
- pattrib->MacIDValidEntry[1]
- );
- } else if (pattrib->pkt_rpt_type == HIS_REPORT) {
- interrupt_handler_8188eu(adapt, pattrib->pkt_len, precvframe->rx_data);
- }
+ } else if (pattrib->pkt_rpt_type == TX_REPORT1) {
+ /* CCX-TXRPT ack for xmit mgmt frames. */
+ handle_txrpt_ccx_88e(adapt, precvframe->rx_data);
+ rtw_free_recvframe(precvframe, pfree_recv_queue);
+ } else if (pattrib->pkt_rpt_type == TX_REPORT2) {
+ ODM_RA_TxRPT2Handle_8188E(
+ &haldata->odmpriv,
+ precvframe->rx_data,
+ pattrib->pkt_len,
+ pattrib->MacIDValidEntry[0],
+ pattrib->MacIDValidEntry[1]
+ );
+ rtw_free_recvframe(precvframe, pfree_recv_queue);
+ } else if (pattrib->pkt_rpt_type == HIS_REPORT) {
+ interrupt_handler_8188eu(adapt, pattrib->pkt_len, precvframe->rx_data);
rtw_free_recvframe(precvframe, pfree_recv_queue);
}
pkt_cnt--;
--
2.7.3

2016-10-07 18:03:00

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 15/34] staging:r8188eu: remove Antenna_(Lfet|Right) enumeration items

These defintions does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/usb_halinit.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index b1740cf..87e379e 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -601,11 +601,6 @@ static void _BBTurnOnBlock(struct adapter *Adapter)
phy_set_bb_reg(Adapter, rFPGA0_RFMOD, bOFDMEn, 0x1);
}

-enum {
- Antenna_Lfet = 1,
- Antenna_Right = 2,
-};
-
static void _InitAntenna_Selection(struct adapter *Adapter)
{
struct hal_data_8188e *haldata = Adapter->HalData;
--
2.7.3

2016-10-07 18:03:11

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 20/34] staging:r8188eu: remove bTXPowerTrackingInit member of odm_rf_cal structure

bTXPowerTrackingInit assigned, but not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/odm.c | 1 -
drivers/staging/rtl8188eu/hal/phy.c | 1 -
drivers/staging/rtl8188eu/include/odm.h | 1 -
3 files changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c
index d983a80..16476e7 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -991,7 +991,6 @@ void odm_TXPowerTrackingThermalMeterInit(struct odm_dm_struct *pDM_Odm)
{
pDM_Odm->RFCalibrateInfo.bTXPowerTracking = true;
pDM_Odm->RFCalibrateInfo.TXPowercount = 0;
- pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = false;
if (*(pDM_Odm->mp_mode) != 1)
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = true;
MSG_88E("pDM_Odm TxPowerTrackControl = %d\n", pDM_Odm->RFCalibrateInfo.TxPowerTrackControl);
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 126547e..109c2d7 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -412,7 +412,6 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
dm_txpwr_track_setpwr(dm_odm);

dm_odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++;
- dm_odm->RFCalibrateInfo.bTXPowerTrackingInit = true;

dm_odm->RFCalibrateInfo.RegA24 = 0x090e1317;

diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/staging/rtl8188eu/include/odm.h
index 805f52e..0c15e5f 100644
--- a/drivers/staging/rtl8188eu/include/odm.h
+++ b/drivers/staging/rtl8188eu/include/odm.h
@@ -590,7 +590,6 @@ struct odm_rf_cal {
s32 RegEBC;

u8 TXPowercount;
- bool bTXPowerTrackingInit;
bool bTXPowerTracking;
u8 TxPowerTrackControl; /* for mp mode, turn off txpwrtracking
* as default */
--
2.7.3

2016-10-07 18:03:21

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 11/34] staging:r8188eu: remove bLedStartToLinkBlinkInProgress and bSWLedCtrl members of LED_871x structure

These members of LED_871x structure does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_led.c | 1 -
drivers/staging/rtl8188eu/include/rtw_led.h | 3 ---
2 files changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c
index d26b795..a046a02 100644
--- a/drivers/staging/rtl8188eu/core/rtw_led.c
+++ b/drivers/staging/rtl8188eu/core/rtw_led.c
@@ -60,7 +60,6 @@ void ResetLedStatus(struct LED_871x *pLed)

pLed->bLedNoLinkBlinkInProgress = false;
pLed->bLedLinkBlinkInProgress = false;
- pLed->bLedStartToLinkBlinkInProgress = false;
pLed->bLedScanBlinkInProgress = false;
}

diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h
index 217ca00..607d1ba 100644
--- a/drivers/staging/rtl8188eu/include/rtw_led.h
+++ b/drivers/staging/rtl8188eu/include/rtw_led.h
@@ -70,12 +70,9 @@ struct LED_871x {

struct timer_list BlinkTimer; /* Timer object for led blinking. */

- u8 bSWLedCtrl;
-
/* ALPHA, added by chiyoko, 20090106 */
u8 bLedNoLinkBlinkInProgress;
u8 bLedLinkBlinkInProgress;
- u8 bLedStartToLinkBlinkInProgress;
u8 bLedScanBlinkInProgress;
struct work_struct BlinkWorkItem; /* Workitem used by BlinkTimer to
* manipulate H/W to blink LED. */
--
2.7.3

2016-10-07 18:12:41

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 09/34] staging:r8188eu: remove wrappers for LedControl8188eu function

There is no reason to use these wrappers.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 +++---
drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 ++--
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 2 +-
drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++--
drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +-
drivers/staging/rtl8188eu/hal/rtl8188eu_led.c | 1 -
drivers/staging/rtl8188eu/include/rtw_led.h | 8 --------
drivers/staging/rtl8188eu/os_dep/os_intfs.c | 8 ++++----
8 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index f1f4788..36109ce 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -308,7 +308,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
mod_timer(&pmlmepriv->scan_to_timer,
jiffies + msecs_to_jiffies(SCANNING_TIMEOUT));

- rtw_led_control(padapter, LED_CTL_SITE_SURVEY);
+ LedControl8188eu(padapter, LED_CTL_SITE_SURVEY);

pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */
} else {
@@ -335,7 +335,7 @@ u8 rtw_createbss_cmd(struct adapter *padapter)
u8 res = _SUCCESS;


- rtw_led_control(padapter, LED_CTL_START_TO_LINK);
+ LedControl8188eu(padapter, LED_CTL_START_TO_LINK);

if (pmlmepriv->assoc_ssid.SsidLength == 0)
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for Any SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
@@ -379,7 +379,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);


- rtw_led_control(padapter, LED_CTL_START_TO_LINK);
+ LedControl8188eu(padapter, LED_CTL_START_TO_LINK);

if (pmlmepriv->assoc_ssid.SsidLength == 0)
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+Join cmd: Any SSid\n"));
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index ee2dcd0..032f783 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -801,7 +801,7 @@ void rtw_indicate_connect(struct adapter *padapter)
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
set_fwstate(pmlmepriv, _FW_LINKED);

- rtw_led_control(padapter, LED_CTL_LINK);
+ LedControl8188eu(padapter, LED_CTL_LINK);

rtw_os_indicate_connect(padapter);
}
@@ -833,7 +833,7 @@ void rtw_indicate_disconnect(struct adapter *padapter)
rtw_os_indicate_disconnect(padapter);

_clr_fwstate_(pmlmepriv, _FW_LINKED);
- rtw_led_control(padapter, LED_CTL_NO_LINK);
+ LedControl8188eu(padapter, LED_CTL_NO_LINK);
rtw_clear_scan_deny(padapter);
}

diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
index fc6385b..4032121 100644
--- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
@@ -56,7 +56,7 @@ static int rtw_hw_suspend(struct adapter *padapter)
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
_clr_fwstate_(pmlmepriv, _FW_LINKED);

- rtw_led_control(padapter, LED_CTL_NO_LINK);
+ LedControl8188eu(padapter, LED_CTL_NO_LINK);

rtw_os_indicate_disconnect(padapter);

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 65ae11e..1b544e6 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1293,7 +1293,7 @@ static int validate_recv_frame(struct adapter *adapter,
retval = _FAIL; /* only data frame return _SUCCESS */
break;
case WIFI_DATA_TYPE: /* data */
- rtw_led_control(adapter, LED_CTL_RX);
+ LedControl8188eu(adapter, LED_CTL_RX);
pattrib->qos = (subtype & BIT(7)) ? 1 : 0;
retval = validate_recv_data_frame(adapter, precv_frame);
if (retval == _FAIL) {
@@ -1988,7 +1988,7 @@ static int recv_func_posthandle(struct adapter *padapter,
struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;

/* DATA FRAME */
- rtw_led_control(padapter, LED_CTL_RX);
+ LedControl8188eu(padapter, LED_CTL_RX);

prframe = decryptor(padapter, prframe);
if (prframe == NULL) {
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 0f8b8e0..2b641f5 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -1677,7 +1677,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
}
pxmitframe->pkt = *ppkt;

- rtw_led_control(padapter, LED_CTL_TX);
+ LedControl8188eu(padapter, LED_CTL_TX);

pxmitframe->attrib.qsel = pxmitframe->attrib.priority;

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
index 780666a..fe075ad 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
@@ -70,7 +70,6 @@ void rtw_hal_sw_led_init(struct adapter *padapter)
struct led_priv *pledpriv = &(padapter->ledpriv);

pledpriv->bRegUseLed = true;
- pledpriv->LedControlHandler = LedControl8188eu;
padapter->HalData->bLedOpenDrain = true;

InitLed871x(padapter, &(pledpriv->SwLed0));
diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h
index f2054ef..79f318f 100644
--- a/drivers/staging/rtl8188eu/include/rtw_led.h
+++ b/drivers/staging/rtl8188eu/include/rtw_led.h
@@ -92,17 +92,9 @@ struct led_priv {
/* add for led control */
struct LED_871x SwLed0;
u8 bRegUseLed;
- void (*LedControlHandler)(struct adapter *padapter,
- enum LED_CTL_MODE LedAction);
/* add for led control */
};

-#define rtw_led_control(adapt, action) \
- do { \
- if ((adapt)->ledpriv.LedControlHandler) \
- (adapt)->ledpriv.LedControlHandler((adapt), (action)); \
- } while (0)
-
void BlinkTimerCallback(unsigned long data);
void BlinkWorkItemCallback(struct work_struct *work);

diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 2a1e63d..c933883 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -597,7 +597,7 @@ static int _netdev_open(struct net_device *pnetdev)
}
rtw_hal_inirp_init(padapter);

- rtw_led_control(padapter, LED_CTL_NO_LINK);
+ LedControl8188eu(padapter, LED_CTL_NO_LINK);

padapter->bup = true;
}
@@ -681,7 +681,7 @@ int rtw_ips_pwr_up(struct adapter *padapter)

result = ips_netdrv_open(padapter);

- rtw_led_control(padapter, LED_CTL_NO_LINK);
+ LedControl8188eu(padapter, LED_CTL_NO_LINK);

DBG_88E("<=== rtw_ips_pwr_up.............. in %dms\n",
jiffies_to_msecs(jiffies - start_time));
@@ -696,7 +696,7 @@ void rtw_ips_pwr_down(struct adapter *padapter)

padapter->net_closed = true;

- rtw_led_control(padapter, LED_CTL_POWER_OFF);
+ LedControl8188eu(padapter, LED_CTL_POWER_OFF);

rtw_ips_dev_unload(padapter);
DBG_88E("<=== rtw_ips_pwr_down..................... in %dms\n",
@@ -749,7 +749,7 @@ static int netdev_close(struct net_device *pnetdev)
/* s2-4. */
rtw_free_network_queue(padapter, true);
/* Close LED */
- rtw_led_control(padapter, LED_CTL_POWER_OFF);
+ LedControl8188eu(padapter, LED_CTL_POWER_OFF);
}

RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - drv_close\n"));
--
2.7.3

2016-10-07 18:13:34

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 30/34] staging:r8188eu: remove rx_pending_cnt member of recv_priv structure

Value of this variable does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 2 --
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 --
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 4 ----
3 files changed, 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index b5aeb8d..f046c41 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -87,8 +87,6 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
precvframe->adapter = padapter;
precvframe++;
}
- precvpriv->rx_pending_cnt = 1;
-
res = rtw_hal_init_recv_priv(padapter);

setup_timer(&precvpriv->signal_stat_timer,
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 40f9728..ffbbbd1 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -173,8 +173,6 @@ struct recv_priv {
u64 rx_drop;
u64 last_rx_bytes;

- u8 rx_pending_cnt;
-
struct tasklet_struct irq_prepare_beacon_tasklet;
struct tasklet_struct recv_tasklet;
struct sk_buff_head free_recv_skb_queue;
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index b87663b..9347dcd 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -384,8 +384,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)

RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete!!!\n"));

- precvpriv->rx_pending_cnt--;
-
if (adapt->bSurpriseRemoved || adapt->bDriverStopped || adapt->bReadPortCancel) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n",
@@ -490,8 +488,6 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, struct recv_buf *precvbuf)
precvbuf->reuse = false;
}

- precvpriv->rx_pending_cnt++;
-
purb = precvbuf->purb;

/* translate DMA FIFO addr to pipehandle */
--
2.7.3

2016-10-07 18:13:44

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 17/34] staging:r8188eu: remove RF_TYPE_8190P enumeration

This enumeration does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h b/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
index 0976a76..550ad62 100644
--- a/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
+++ b/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
@@ -99,17 +99,6 @@ enum phy_rate_tx_offset_area {
RA_OFFSET_HT_CCK,
};

-/* BB/RF related */
-enum RF_TYPE_8190P {
- RF_TYPE_MIN, /* 0 */
- RF_8225 = 1, /* 1 11b/g RF for verification only */
- RF_8256 = 2, /* 2 11b/g/n */
- RF_8258 = 3, /* 3 11a/b/g/n RF */
- RF_6052 = 4, /* 4 11b/g/n RF */
- /* TODO: We should remove this psudo PHY RF after we get new RF. */
- RF_PSEUDO_11N = 5, /* 5, It is a temporality RF. */
-};
-
struct bb_reg_def {
u32 rfintfs; /* set software control: */
/* 0x870~0x877[8 bytes] */
--
2.7.3

2016-10-07 18:13:55

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 12/34] staging:r8188eu: remove bLedOpenDrain member of hal_data_8188e structure

bLedOpenDrain always is true.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/rtl8188eu_led.c | 18 ++++++------------
drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 2 --
2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
index a6d775b..12879af 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
@@ -46,16 +46,12 @@ void SwLedOff(struct adapter *padapter, struct LED_871x *pLed)

LedCfg = usb_read8(padapter, REG_LEDCFG2);/* 0x4E */

- if (padapter->HalData->bLedOpenDrain) {
- /* Open-drain arrangement for controlling the LED) */
- LedCfg &= 0x90; /* Set to software control. */
- usb_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3)));
- LedCfg = usb_read8(padapter, REG_MAC_PINMUX_CFG);
- LedCfg &= 0xFE;
- usb_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
- } else {
- usb_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3) | BIT(5) | BIT(6)));
- }
+ /* Open-drain arrangement for controlling the LED) */
+ LedCfg &= 0x90; /* Set to software control. */
+ usb_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3)));
+ LedCfg = usb_read8(padapter, REG_MAC_PINMUX_CFG);
+ LedCfg &= 0xFE;
+ usb_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
exit:
pLed->bLedOn = false;
}
@@ -69,8 +65,6 @@ void rtw_hal_sw_led_init(struct adapter *padapter)
{
struct led_priv *pledpriv = &(padapter->ledpriv);

- padapter->HalData->bLedOpenDrain = true;
-
InitLed871x(padapter, &(pledpriv->SwLed0));
}

diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index 7c81e3f..19264a2 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -270,8 +270,6 @@ struct hal_data_8188e {
u8 BluetoothCoexist;
u8 ExternalPA;

- u8 bLedOpenDrain; /* Open-drain support for controlling the LED.*/
-
u8 b1x1RecvCombine; /* for 1T1R receive combining */

u32 AcParam_BE; /* Original parameter for BE, use for EDCA turbo. */
--
2.7.3

2016-10-07 18:14:05

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 10/34] staging:r8188eu: remove bRegUseLed member of led_priv structure

bRegUseLed always is true.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_led.c | 5 -----
drivers/staging/rtl8188eu/hal/rtl8188eu_led.c | 1 -
drivers/staging/rtl8188eu/include/rtw_led.h | 1 -
3 files changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c
index 14461cf..d26b795 100644
--- a/drivers/staging/rtl8188eu/core/rtw_led.c
+++ b/drivers/staging/rtl8188eu/core/rtw_led.c
@@ -475,15 +475,10 @@ void BlinkHandler(struct LED_871x *pLed)

void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction)
{
- struct led_priv *ledpriv = &(padapter->ledpriv);
-
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) ||
(!padapter->hw_init_completed))
return;

- if (!ledpriv->bRegUseLed)
- return;
-
if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on &&
padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) &&
(LedAction == LED_CTL_TX || LedAction == LED_CTL_RX ||
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
index fe075ad..a6d775b 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_led.c
@@ -69,7 +69,6 @@ void rtw_hal_sw_led_init(struct adapter *padapter)
{
struct led_priv *pledpriv = &(padapter->ledpriv);

- pledpriv->bRegUseLed = true;
padapter->HalData->bLedOpenDrain = true;

InitLed871x(padapter, &(pledpriv->SwLed0));
diff --git a/drivers/staging/rtl8188eu/include/rtw_led.h b/drivers/staging/rtl8188eu/include/rtw_led.h
index 79f318f..217ca00 100644
--- a/drivers/staging/rtl8188eu/include/rtw_led.h
+++ b/drivers/staging/rtl8188eu/include/rtw_led.h
@@ -91,7 +91,6 @@ void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction);
struct led_priv {
/* add for led control */
struct LED_871x SwLed0;
- u8 bRegUseLed;
/* add for led control */
};

--
2.7.3

2016-10-07 18:14:14

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 06/34] staging:r8188eu: change usb_read_port last argument type to (struct *recv_buf)

To avoid unnecessary typecasts.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/usb_halinit.c | 2 +-
drivers/staging/rtl8188eu/include/usb_ops_linux.h | 2 +-
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 9 ++++-----
3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index a09c68f..4d0e3f9 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -999,7 +999,7 @@ u32 rtw_hal_inirp_init(struct adapter *Adapter)
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
- if (usb_read_port(Adapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false) {
+ if (usb_read_port(Adapter, precvpriv->ff_hwaddr, 0, precvbuf) == false) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_port error\n"));
status = _FAIL;
goto exit;
diff --git a/drivers/staging/rtl8188eu/include/usb_ops_linux.h b/drivers/staging/rtl8188eu/include/usb_ops_linux.h
index 78d9b6e..4fc2e2d 100644
--- a/drivers/staging/rtl8188eu/include/usb_ops_linux.h
+++ b/drivers/staging/rtl8188eu/include/usb_ops_linux.h
@@ -53,7 +53,7 @@ u8 usb_read8(struct adapter *adapter, u32 addr);
u16 usb_read16(struct adapter *adapter, u32 addr);
u32 usb_read32(struct adapter *adapter, u32 addr);

-u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
+u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, struct recv_buf *precvbuf);
void usb_read_port_cancel(struct adapter *adapter);

int usb_write8(struct adapter *adapter, u32 addr, u8 val);
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index b820482..22777b1 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -403,7 +403,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n"));
precvbuf->reuse = true;
- usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
+ usb_read_port(adapt, precvpriv->ff_hwaddr, 0, precvbuf);
DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
} else {
skb_put(precvbuf->pskb, purb->actual_length);
@@ -414,7 +414,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)

precvbuf->pskb = NULL;
precvbuf->reuse = false;
- usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
+ usb_read_port(adapt, precvpriv->ff_hwaddr, 0, precvbuf);
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
@@ -437,7 +437,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
case -EOVERFLOW:
adapt->HalData->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL;
precvbuf->reuse = true;
- usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
+ usb_read_port(adapt, precvpriv->ff_hwaddr, 0, precvbuf);
break;
case -EINPROGRESS:
DBG_88E("ERROR: URB IS IN PROGRESS!\n");
@@ -448,10 +448,9 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
}
}

-u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
+u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, struct recv_buf *precvbuf)
{
struct urb *purb = NULL;
- struct recv_buf *precvbuf = (struct recv_buf *)rmem;
struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
struct recv_priv *precvpriv = &adapter->recvpriv;
struct usb_device *pusbd = pdvobj->pusbdev;
--
2.7.3

2016-10-07 18:14:26

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 28/34] staging:r8188eu: remove intf_stop member of adapter structure

call usb_intf_stop directly.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/drv_types.h | 1 -
drivers/staging/rtl8188eu/include/hal_intf.h | 1 +
drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +--
drivers/staging/rtl8188eu/os_dep/usb_intf.c | 7 ++-----
4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h
index 5eb56b1..e86419e 100644
--- a/drivers/staging/rtl8188eu/include/drv_types.h
+++ b/drivers/staging/rtl8188eu/include/drv_types.h
@@ -156,7 +156,6 @@ struct adapter {
u8 hw_init_completed;

void *cmdThread;
- void (*intf_stop)(struct adapter *adapter);
struct net_device *pnetdev;
struct net_device *pmondev;

diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h b/drivers/staging/rtl8188eu/include/hal_intf.h
index fa032b0..e1114a9 100644
--- a/drivers/staging/rtl8188eu/include/hal_intf.h
+++ b/drivers/staging/rtl8188eu/include/hal_intf.h
@@ -190,6 +190,7 @@ void rtw_hal_set_odm_var(struct adapter *padapter,

u32 rtw_hal_inirp_init(struct adapter *padapter);
void rtw_hal_inirp_deinit(struct adapter *padapter);
+void usb_intf_stop(struct adapter *padapter);

s32 rtw_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe);
s32 rtw_hal_mgnt_xmit(struct adapter *padapter,
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index c933883..8fc3fad 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -709,8 +709,7 @@ void rtw_ips_dev_unload(struct adapter *padapter)

rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, NULL);

- if (padapter->intf_stop)
- padapter->intf_stop(padapter);
+ usb_intf_stop(padapter);

/* s5. */
if (!padapter->bSurpriseRemoved)
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 94dac53..c6316ff 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -141,7 +141,7 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)

}

-static void usb_intf_stop(struct adapter *padapter)
+void usb_intf_stop(struct adapter *padapter)
{
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+usb_intf_stop\n"));

@@ -174,8 +174,7 @@ static void rtw_dev_unload(struct adapter *padapter)
if (padapter->xmitpriv.ack_tx)
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
/* s3. */
- if (padapter->intf_stop)
- padapter->intf_stop(padapter);
+ usb_intf_stop(padapter);
/* s4. */
if (!padapter->pwrctrlpriv.bInternalAutoSuspend)
rtw_stop_drv_threads(padapter);
@@ -357,8 +356,6 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
if (!padapter->HalData)
DBG_88E("cant not alloc memory for HAL DATA\n");

- padapter->intf_stop = &usb_intf_stop;
-
/* step read_chip_version */
rtw_hal_read_chip_version(padapter);

--
2.7.3

2016-10-07 18:15:28

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 21/34] staging:r8188eu: remove ANTTEST(ALL|A|B) definitions

These defintions does not used.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/include/odm.h | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/staging/rtl8188eu/include/odm.h
index 0c15e5f..4fb3bb0 100644
--- a/drivers/staging/rtl8188eu/include/odm.h
+++ b/drivers/staging/rtl8188eu/include/odm.h
@@ -80,11 +80,6 @@
#define DM_DIG_FA_TH2_LPS 30 /* 30 lps */
#define RSSI_OFFSET_DIG 0x05;

-/* ANT Test */
-#define ANTTESTALL 0x00 /* Ant A or B will be Testing */
-#define ANTTESTA 0x01 /* Ant A will be Testing */
-#define ANTTESTB 0x02 /* Ant B will be testing */
-
struct rtw_dig {
u8 Dig_Enable_Flag;
u8 Dig_Ext_Port_Stage;
--
2.7.3

2016-10-07 18:15:53

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 26/34] staging:r8188eu: change type of the precv_buf member of recv_priv structure

To avoid unnecessary typecast.
To use compiler type checking.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 6 +++---
drivers/staging/rtl8188eu/hal/usb_halinit.c | 2 +-
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +-
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index 1c7a9a0..d3d64fa 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -46,10 +46,10 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
goto exit;
}

- precvpriv->precv_buf = precvpriv->pallocated_recv_buf;
+ precvpriv->precv_buf = (struct recv_buf *)precvpriv->pallocated_recv_buf;


- precvbuf = (struct recv_buf *)precvpriv->precv_buf;
+ precvbuf = precvpriv->precv_buf;

for (i = 0; i < NR_RECVBUFF; i++) {
res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf);
@@ -86,7 +86,7 @@ void rtw_hal_free_recv_priv(struct adapter *padapter)
struct recv_buf *precvbuf;
struct recv_priv *precvpriv = &padapter->recvpriv;

- precvbuf = (struct recv_buf *)precvpriv->precv_buf;
+ precvbuf = precvpriv->precv_buf;

for (i = 0; i < NR_RECVBUFF; i++) {
usb_free_urb(precvbuf->purb);
diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 71d6ade..3675edb 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -987,7 +987,7 @@ u32 rtw_hal_inirp_init(struct adapter *Adapter)
("===> usb_inirp_init\n"));

/* issue Rx irp to receive data */
- precvbuf = (struct recv_buf *)precvpriv->precv_buf;
+ precvbuf = precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
if (usb_read_port(Adapter, RECV_BULK_IN_ADDR, precvbuf) == false) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_port error\n"));
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index e871ebb..8fa3b81 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -181,7 +181,7 @@ struct recv_priv {
struct sk_buff_head free_recv_skb_queue;
struct sk_buff_head rx_skb_queue;
u8 *pallocated_recv_buf;
- u8 *precv_buf; /* 4 alignment */
+ struct recv_buf *precv_buf; /* 4 alignment */
struct __queue free_recv_buf_queue;
/* For display the phy informatiom */
u8 is_signal_dbg; /* for debug */
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index 175c1ae..b87663b 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -521,7 +521,7 @@ void rtw_hal_inirp_deinit(struct adapter *padapter)
int i;
struct recv_buf *precvbuf;

- precvbuf = (struct recv_buf *)padapter->recvpriv.precv_buf;
+ precvbuf = padapter->recvpriv.precv_buf;

DBG_88E("%s\n", __func__);

--
2.7.3

2016-10-07 18:17:58

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 16/34] staging:r8188eu: remove rf_chip member of hal_data_8188e structure

This member is constant.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/phy.c | 13 +------------
drivers/staging/rtl8188eu/hal/usb_halinit.c | 6 ------
drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 1 -
3 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 5192ef7..84ffc01 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -210,13 +210,6 @@ static void phy_set_bw_mode_callback(struct adapter *adapt)
u8 reg_bw_opmode;
u8 reg_prsr_rsc;

- if (hal_data->rf_chip == RF_PSEUDO_11N)
- return;
-
- /* There is no 40MHz mode in RF_8225. */
- if (hal_data->rf_chip == RF_8225)
- return;
-
if (adapt->bDriverStopped)
return;

@@ -265,8 +258,7 @@ static void phy_set_bw_mode_callback(struct adapter *adapt)
}

/* Set RF related register */
- if (hal_data->rf_chip == RF_6052)
- rtl88eu_phy_rf6052_set_bandwidth(adapt, hal_data->CurrentChannelBW);
+ rtl88eu_phy_rf6052_set_bandwidth(adapt, hal_data->CurrentChannelBW);
}

void rtw_hal_set_bwmode(struct adapter *adapt, enum ht_channel_width bandwidth,
@@ -307,9 +299,6 @@ void rtw_hal_set_chan(struct adapter *adapt, u8 channel)
struct hal_data_8188e *hal_data = adapt->HalData;
u8 tmpchannel = hal_data->CurrentChannel;

- if (hal_data->rf_chip == RF_PSEUDO_11N)
- return;
-
if (channel == 0)
channel = 1;

diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 87e379e..71d6ade 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -1096,18 +1096,12 @@ static void _ReadPROMContent(
readAdapterInfo_8188EU(Adapter);
}

-static void _ReadRFType(struct adapter *Adapter)
-{
- Adapter->HalData->rf_chip = RF_6052;
-}
-
void rtw_hal_read_chip_info(struct adapter *Adapter)
{
unsigned long start = jiffies;

MSG_88E("====> %s\n", __func__);

- _ReadRFType(Adapter);/* rf_chip -> _InitRFType() */
_ReadPROMContent(Adapter);

MSG_88E("<==== %s in %d ms\n", __func__,
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index 53c975a..226e89b 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -201,7 +201,6 @@ struct hal_data_8188e {
u16 BasicRateSet;

/* rf_ctrl */
- u8 rf_chip;
u8 NumTotalRFPath;

u8 BoardType;
--
2.7.3

2016-10-07 18:49:01

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 13/34] staging:r8188eu: remove ExternalPA member of hal_data_8188e structure

ExternalPA always is false.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/rf.c | 2 --
drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 1 -
2 files changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rf.c b/drivers/staging/rtl8188eu/hal/rf.c
index 2f3edf0..eddd075 100644
--- a/drivers/staging/rtl8188eu/hal/rf.c
+++ b/drivers/staging/rtl8188eu/hal/rf.c
@@ -61,8 +61,6 @@ void rtl88eu_phy_rf6052_set_cck_txpower(struct adapter *adapt, u8 *powerlevel)
(powerlevel[idx1]<<8) |
(powerlevel[idx1]<<16) |
(powerlevel[idx1]<<24);
- if (tx_agc[idx1] > 0x20 && hal_data->ExternalPA)
- tx_agc[idx1] = 0x20;
}
} else {
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1) {
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index 19264a2..942ce91 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -268,7 +268,6 @@ struct hal_data_8188e {
u32 AntennaTxPath; /* Antenna path Tx */
u32 AntennaRxPath; /* Antenna path Rx */
u8 BluetoothCoexist;
- u8 ExternalPA;

u8 b1x1RecvCombine; /* for 1T1R receive combining */

--
2.7.3

2016-10-07 18:49:34

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 31/34] staging:r8188eu: remove precv_frame_buf member of recv_priv structure

precv_frame_buf is used as local variable only in one function.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 4 +---
drivers/staging/rtl8188eu/include/rtw_recv.h | 1 -
2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index f046c41..a1b30a5 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -71,9 +71,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
if (!precvpriv->pallocated_frame_buf)
return _FAIL;

- precvpriv->precv_frame_buf = PTR_ALIGN(precvpriv->pallocated_frame_buf, RXFRAME_ALIGN_SZ);
-
- precvframe = (struct recv_frame *)precvpriv->precv_frame_buf;
+ precvframe = (struct recv_frame *)PTR_ALIGN(precvpriv->pallocated_frame_buf, RXFRAME_ALIGN_SZ);

for (i = 0; i < NR_RECVFRAME; i++) {
INIT_LIST_HEAD(&(precvframe->list));
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index ffbbbd1..979961d 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -165,7 +165,6 @@ struct recv_priv {
struct __queue recv_pending_queue;
struct __queue uc_swdec_pending_queue;
u8 *pallocated_frame_buf;
- u8 *precv_frame_buf;
struct adapter *adapter;
u32 bIsAnyNonBEPkts;
u64 rx_bytes;
--
2.7.3

2016-10-07 19:08:39

by Ivan Safonov

[permalink] [raw]
Subject: [PATCH 05/34] staging:r8188eu: remove skb data alignment in r8188eu driver code

(__)netdev_alloc_skb align skb data.
Also this function set skb device.

Signed-off-by: Ivan Safonov <[email protected]>
---
drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 10 +---------
drivers/staging/rtl8188eu/include/rtw_recv.h | 2 --
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 8 +-------
3 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index 67a765a..1c7a9a0 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -61,23 +61,15 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
skb_queue_head_init(&precvpriv->rx_skb_queue);
{
int i;
- size_t tmpaddr = 0;
- size_t alignm = 0;
struct sk_buff *pskb = NULL;

skb_queue_head_init(&precvpriv->free_recv_skb_queue);

for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) {
pskb = __netdev_alloc_skb(padapter->pnetdev,
- MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ,
- GFP_KERNEL);
+ MAX_RECVBUF_SZ, GFP_KERNEL);
if (pskb) {
kmemleak_not_leak(pskb);
- pskb->dev = padapter->pnetdev;
- tmpaddr = (size_t)pskb->data;
- alignm = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
- skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignm));
-
skb_queue_tail(&precvpriv->free_recv_skb_queue,
pskb);
}
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index a8874a2..c868863 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -139,8 +139,6 @@ struct rx_pkt_attrib {
#define SN_EQUAL(a, b) (a == b)
#define REORDER_WAIT_TIME (50) /* (ms) */

-#define RECVBUFF_ALIGN_SZ 8
-
#define RXDESC_SIZE 24
#define RXDESC_OFFSET RXDESC_SIZE

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index d0d5915..b820482 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -457,8 +457,6 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
struct usb_device *pusbd = pdvobj->pusbdev;
int err;
unsigned int pipe;
- size_t tmpaddr = 0;
- size_t alignment = 0;
u32 ret = _SUCCESS;


@@ -483,16 +481,12 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)

/* re-assign for linux based on skb */
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
- precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
+ precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ);
if (precvbuf->pskb == NULL) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n"));
DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
return _FAIL;
}
-
- tmpaddr = (size_t)precvbuf->pskb->data;
- alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
- skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
} else { /* reuse skb */
precvbuf->reuse = false;
}
--
2.7.3