Commit edd20e96 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: Move device_set_multi code call to vRunCommand

device_set_multi is an atomic call, in order to reduce atomic area of driver
move code to be called from vRunCommand.

Later the atomic area of vRunCommand can be reduced.

Change existing code in device_set_multi to new function
vnt_configure_filter minus its locks.

Change device_set_multi to call bScheduleCommand

device_set_multi is nolonger called from device open.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f764e00d
...@@ -789,5 +789,6 @@ struct vnt_private { ...@@ -789,5 +789,6 @@ struct vnt_private {
(fMP_DISCONNECTED | fMP_RESET_IN_PROGRESS | fMP_HALT_IN_PROGRESS | fMP_INIT_IN_PROGRESS | fMP_SURPRISE_REMOVED)) == 0) (fMP_DISCONNECTED | fMP_RESET_IN_PROGRESS | fMP_HALT_IN_PROGRESS | fMP_INIT_IN_PROGRESS | fMP_SURPRISE_REMOVED)) == 0)
int device_alloc_frag_buf(struct vnt_private *, PSDeFragControlBlock pDeF); int device_alloc_frag_buf(struct vnt_private *, PSDeFragControlBlock pDeF);
void vnt_configure_filter(struct vnt_private *);
#endif #endif
...@@ -974,8 +974,6 @@ static int device_open(struct net_device *dev) ...@@ -974,8 +974,6 @@ static int device_open(struct net_device *dev)
goto free_all; goto free_all;
} }
device_set_multi(pDevice->dev);
/* init for key management */ /* init for key management */
KeyvInitTable(pDevice,&pDevice->sKey); KeyvInitTable(pDevice,&pDevice->sKey);
memcpy(pDevice->vnt_mgmt.abyMACAddr, memcpy(pDevice->vnt_mgmt.abyMACAddr,
...@@ -1349,14 +1347,26 @@ static int Read_config_file(struct vnt_private *pDevice) ...@@ -1349,14 +1347,26 @@ static int Read_config_file(struct vnt_private *pDevice)
static void device_set_multi(struct net_device *dev) static void device_set_multi(struct net_device *dev)
{ {
struct vnt_private *priv = netdev_priv(dev); struct vnt_private *priv = netdev_priv(dev);
unsigned long flags;
if (priv->flags & DEVICE_FLAGS_OPENED) {
spin_lock_irqsave(&priv->lock, flags);
bScheduleCommand(priv, WLAN_CMD_CONFIGURE_FILTER, NULL);
spin_unlock_irqrestore(&priv->lock, flags);
}
}
void vnt_configure_filter(struct vnt_private *priv)
{
struct net_device *dev = priv->dev;
struct vnt_manager *mgmt = &priv->vnt_mgmt; struct vnt_manager *mgmt = &priv->vnt_mgmt;
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
u64 mc_filter = 0; u64 mc_filter = 0;
u8 tmp = 0; u8 tmp = 0;
int rc; int rc;
spin_lock_irq(&priv->lock);
rc = CONTROLnsRequestIn(priv, MESSAGE_TYPE_READ, rc = CONTROLnsRequestIn(priv, MESSAGE_TYPE_READ,
MAC_REG_RCR, MESSAGE_REQUEST_MACREG, 1, &tmp); MAC_REG_RCR, MESSAGE_REQUEST_MACREG, 1, &tmp);
if (rc == 0) if (rc == 0)
...@@ -1403,8 +1413,6 @@ static void device_set_multi(struct net_device *dev) ...@@ -1403,8 +1413,6 @@ static void device_set_multi(struct net_device *dev)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"priv->byRxMode out= %x\n", priv->byRxMode); "priv->byRxMode out= %x\n", priv->byRxMode);
spin_unlock_irq(&priv->lock);
} }
static struct net_device_stats *device_get_stats(struct net_device *dev) static struct net_device_stats *device_get_stats(struct net_device *dev)
......
...@@ -909,6 +909,10 @@ void vRunCommand(struct work_struct *work) ...@@ -909,6 +909,10 @@ void vRunCommand(struct work_struct *work)
s_bCommandComplete(pDevice); s_bCommandComplete(pDevice);
break; break;
case WLAN_CMD_CONFIGURE_FILTER_START:
vnt_configure_filter(pDevice);
s_bCommandComplete(pDevice);
break;
default: default:
s_bCommandComplete(pDevice); s_bCommandComplete(pDevice);
break; break;
...@@ -1009,6 +1013,11 @@ static int s_bCommandComplete(struct vnt_private *pDevice) ...@@ -1009,6 +1013,11 @@ static int s_bCommandComplete(struct vnt_private *pDevice)
pDevice->eCommandState = WLAN_CMD_11H_CHSW_START; pDevice->eCommandState = WLAN_CMD_11H_CHSW_START;
break; break;
case WLAN_CMD_CONFIGURE_FILTER:
pDevice->eCommandState =
WLAN_CMD_CONFIGURE_FILTER_START;
break;
default: default:
break; break;
} }
......
...@@ -51,7 +51,8 @@ typedef enum tagCMD_CODE { ...@@ -51,7 +51,8 @@ typedef enum tagCMD_CODE {
WLAN_CMD_REMOVE_ALLKEY, WLAN_CMD_REMOVE_ALLKEY,
WLAN_CMD_MAC_DISPOWERSAVING, WLAN_CMD_MAC_DISPOWERSAVING,
WLAN_CMD_11H_CHSW, WLAN_CMD_11H_CHSW,
WLAN_CMD_RUN_AP WLAN_CMD_RUN_AP,
WLAN_CMD_CONFIGURE_FILTER
} CMD_CODE, *PCMD_CODE; } CMD_CODE, *PCMD_CODE;
#define CMD_Q_SIZE 32 #define CMD_Q_SIZE 32
...@@ -96,6 +97,7 @@ typedef enum tagCMD_STATE { ...@@ -96,6 +97,7 @@ typedef enum tagCMD_STATE {
WLAN_CMD_REMOVE_ALLKEY_START, WLAN_CMD_REMOVE_ALLKEY_START,
WLAN_CMD_MAC_DISPOWERSAVING_START, WLAN_CMD_MAC_DISPOWERSAVING_START,
WLAN_CMD_11H_CHSW_START, WLAN_CMD_11H_CHSW_START,
WLAN_CMD_CONFIGURE_FILTER_START,
WLAN_CMD_IDLE WLAN_CMD_IDLE
} CMD_STATE, *PCMD_STATE; } CMD_STATE, *PCMD_STATE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment