[PATCH 4/7] w35und: move global wbsoft_enabled to struct wbsoft_priv - Kernel
This is a discussion on [PATCH 4/7] w35und: move global wbsoft_enabled to struct wbsoft_priv - Kernel ; This is a preparational step for moving packet_came() to wb35rx.c().
Cc: Pavel Machek
Signed-off-by: Pekka Enberg
---
drivers/staging/winbond/core.h | 2 ++
drivers/staging/winbond/wbusb.c | 11 ++++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/winbond/core.h b/drivers/staging/winbond/core.h
index 64b73bb..c6dd223 100644
--- ...
-
[PATCH 4/7] w35und: move global wbsoft_enabled to struct wbsoft_priv
This is a preparational step for moving packet_came() to wb35rx.c().
Cc: Pavel Machek
Signed-off-by: Pekka Enberg
---
drivers/staging/winbond/core.h | 2 ++
drivers/staging/winbond/wbusb.c | 11 ++++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/winbond/core.h b/drivers/staging/winbond/core.h
index 64b73bb..c6dd223 100644
--- a/drivers/staging/winbond/core.h
+++ b/drivers/staging/winbond/core.h
@@ -39,6 +39,8 @@ struct wbsoft_priv {
struct iw_statistics iw_stats;
u8 LinkName[WB_MAX_LINK_NAME_LEN];
+
+ bool enabled;
};
#endif /* __WINBOND_CORE_H */
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
index 0f70101..246f20b 100644
--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -46,8 +46,6 @@ static struct ieee80211_supported_band wbsoft_band_2GHz = {
.n_bitrates = ARRAY_SIZE(wbsoft_rates),
};
-int wbsoft_enabled;
-
static int wbsoft_add_interface(struct ieee80211_hw *dev,
struct ieee80211_if_init_conf *conf)
{
@@ -129,8 +127,10 @@ static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
static int wbsoft_start(struct ieee80211_hw *dev)
{
- wbsoft_enabled = 1;
- printk("wbsoft_start called\n");
+ struct wbsoft_priv *priv = dev->priv;
+
+ priv->enabled = true;
+
return 0;
}
@@ -393,10 +393,11 @@ error:
void packet_came(struct ieee80211_hw *hw, char *pRxBufferAddress, int PacketSize)
{
+ struct wbsoft_priv *priv = hw->priv;
struct sk_buff *skb;
struct ieee80211_rx_status rx_status = {0};
- if (!wbsoft_enabled)
+ if (!priv->enabled)
return;
skb = dev_alloc_skb(PacketSize);
--
1.5.3.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
[PATCH 6/7] w35und: remove ->skb_array from struct wbsoft_priv
It's not actually used for anything, so remove it.
Cc: Pavel Machek
Signed-off-by: Pekka Enberg
---
drivers/staging/winbond/core.h | 3 ---
drivers/staging/winbond/wblinux.c | 16 ----------------
2 files changed, 0 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/winbond/core.h b/drivers/staging/winbond/core.h
index c6dd223..9c9d5d2 100644
--- a/drivers/staging/winbond/core.h
+++ b/drivers/staging/winbond/core.h
@@ -31,10 +31,7 @@ struct wbsoft_priv {
u32 RxByteCount;
u32 TxByteCount;
- struct sk_buff *skb_array[WBLINUX_PACKET_ARRAY_SIZE];
struct sk_buff *packet_return;
- s32 skb_SetIndex;
- s32 skb_GetIndex;
s32 netif_state_stop; // 1: stop 0: normal
struct iw_statistics iw_stats;
diff --git a/drivers/staging/winbond/wblinux.c b/drivers/staging/winbond/wblinux.c
index 433aa0d..0461516 100644
--- a/drivers/staging/winbond/wblinux.c
+++ b/drivers/staging/winbond/wblinux.c
@@ -19,25 +19,9 @@
void
WBLINUX_stop( struct wbsoft_priv * adapter )
{
- struct sk_buff *pSkb;
-
if (atomic_inc_return(&adapter->ThreadCount) == 1) {
// Shutdown module immediately
adapter->shutdown = 1;
-
- while (adapter->skb_array[ adapter->skb_GetIndex ]) {
- // Trying to free the un-sending packet
- pSkb = adapter->skb_array[ adapter->skb_GetIndex ];
- adapter->skb_array[ adapter->skb_GetIndex ] = NULL;
- if( in_irq() )
- dev_kfree_skb_irq( pSkb );
- else
- dev_kfree_skb( pSkb );
-
- adapter->skb_GetIndex++;
- adapter->skb_GetIndex %= WBLINUX_PACKET_ARRAY_SIZE;
- }
-
#ifdef _PE_STATE_DUMP_
WBDEBUG(( "[w35und] SKB_RELEASE OK\n" ));
#endif
--
1.5.3.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/