Commit f95302ee authored by Ali Bahar's avatar Ali Bahar Committed by Greg Kroah-Hartman

staging: r8712u: Merging Realtek's latest (v2.6.6). tx: NULL _in_ spin lock.

In transmit path, r8712_free_xmitframe(), the pkt pointer is now
NULLed _within_ the spin lock.
Signed-off-by: default avatarAli Bahar <ali@internetDog.org>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0aeb623d
...@@ -181,6 +181,9 @@ struct _adapter { ...@@ -181,6 +181,9 @@ struct _adapter {
struct net_device_stats stats; struct net_device_stats stats;
struct iw_statistics iwstats; struct iw_statistics iwstats;
int pid; /*process id from UI*/ int pid; /*process id from UI*/
_workitem wkFilterRxFF0;
u8 blnEnableRxFF0Filter;
spinlock_t lockRxFF0Filter;
}; };
static inline u8 *myid(struct eeprom_priv *peepriv) static inline u8 *myid(struct eeprom_priv *peepriv)
......
...@@ -152,11 +152,12 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, ...@@ -152,11 +152,12 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
pxmitbuf++; pxmitbuf++;
} }
pxmitpriv->free_xmitbuf_cnt = NR_XMITBUFF; pxmitpriv->free_xmitbuf_cnt = NR_XMITBUFF;
_init_workitem(&padapter->wkFilterRxFF0, r8712_SetFilter, padapter);
alloc_hwxmits(padapter); alloc_hwxmits(padapter);
init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
tasklet_init(&pxmitpriv->xmit_tasklet, tasklet_init(&pxmitpriv->xmit_tasklet,
(void(*)(addr_t))r8712_xmit_bh, (void(*)(unsigned long))r8712_xmit_bh,
(addr_t)padapter); (unsigned long)padapter);
return _SUCCESS; return _SUCCESS;
} }
...@@ -612,7 +613,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt, ...@@ -612,7 +613,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt,
if (make_wlanhdr(padapter, mem_start, pattrib) == _FAIL) if (make_wlanhdr(padapter, mem_start, pattrib) == _FAIL)
return _FAIL; return _FAIL;
_r8712_open_pktfile(pkt, &pktfile); _r8712_open_pktfile(pkt, &pktfile);
_r8712_pktfile_read(&pktfile, NULL, pattrib->pkt_hdrlen); _r8712_pktfile_read(&pktfile, NULL, (uint) pattrib->pkt_hdrlen);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) {
/* truncate TXDESC_SIZE bytes txcmd if at mp mode for 871x */ /* truncate TXDESC_SIZE bytes txcmd if at mp mode for 871x */
if (pattrib->ether_type == 0x8712) { if (pattrib->ether_type == 0x8712) {
...@@ -826,13 +827,16 @@ void r8712_free_xmitframe(struct xmit_priv *pxmitpriv, ...@@ -826,13 +827,16 @@ void r8712_free_xmitframe(struct xmit_priv *pxmitpriv,
unsigned long irqL; unsigned long irqL;
struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;
struct _adapter *padapter = pxmitpriv->adapter; struct _adapter *padapter = pxmitpriv->adapter;
struct sk_buff *pndis_pkt = NULL;
if (pxmitframe == NULL) if (pxmitframe == NULL)
return; return;
if (pxmitframe->pkt)
r8712_xmit_complete(padapter, pxmitframe);
spin_lock_irqsave(&pfree_xmit_queue->lock, irqL); spin_lock_irqsave(&pfree_xmit_queue->lock, irqL);
list_delete(&pxmitframe->list); list_delete(&pxmitframe->list);
if (pxmitframe->pkt) {
pndis_pkt = pxmitframe->pkt;
pxmitframe->pkt = NULL;
}
list_insert_tail(&pxmitframe->list, get_list_head(pfree_xmit_queue)); list_insert_tail(&pxmitframe->list, get_list_head(pfree_xmit_queue));
pxmitpriv->free_xmitframe_cnt++; pxmitpriv->free_xmitframe_cnt++;
spin_unlock_irqrestore(&pfree_xmit_queue->lock, irqL); spin_unlock_irqrestore(&pfree_xmit_queue->lock, irqL);
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
static uint remainder_len(struct pkt_file *pfile) static uint remainder_len(struct pkt_file *pfile)
{ {
/* Kovich: Need to extend the buf_len to 64 bit ?(unsigned long long) */
return (uint)(pfile->buf_len - ((addr_t)(pfile->cur_addr) - return (uint)(pfile->buf_len - ((addr_t)(pfile->cur_addr) -
(addr_t)(pfile->buf_start))); (addr_t)(pfile->buf_start)));
} }
...@@ -109,6 +108,26 @@ void r8712_set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) ...@@ -109,6 +108,26 @@ void r8712_set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
pattrib->subtype = WIFI_QOS_DATA_TYPE; pattrib->subtype = WIFI_QOS_DATA_TYPE;
} }
void r8712_SetFilter(struct work_struct *work)
{
struct _adapter *padapter = container_of(work, struct _adapter,
wkFilterRxFF0);
u8 oldvalue = 0x00, newvalue = 0x00;
unsigned long irqL;
oldvalue = r8712_read8(padapter, 0x117);
newvalue = oldvalue & 0xfe;
r8712_write8(padapter, 0x117, newvalue);
spin_lock_irqsave(&padapter->lockRxFF0Filter, irqL);
padapter->blnEnableRxFF0Filter = 1;
spin_unlock_irqrestore(&padapter->lockRxFF0Filter, irqL);
do {
msleep(100);
} while (padapter->blnEnableRxFF0Filter == 1);
r8712_write8(padapter, 0x117, oldvalue);
}
int r8712_xmit_resource_alloc(struct _adapter *padapter, int r8712_xmit_resource_alloc(struct _adapter *padapter,
struct xmit_buf *pxmitbuf) struct xmit_buf *pxmitbuf)
{ {
......
...@@ -47,6 +47,7 @@ struct xmit_frame; ...@@ -47,6 +47,7 @@ struct xmit_frame;
struct xmit_buf; struct xmit_buf;
int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev); int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev);
void r8712_SetFilter(struct work_struct *work);
int r8712_xmit_resource_alloc(struct _adapter *padapter, int r8712_xmit_resource_alloc(struct _adapter *padapter,
struct xmit_buf *pxmitbuf); struct xmit_buf *pxmitbuf);
void r8712_xmit_resource_free(struct _adapter *padapter, void r8712_xmit_resource_free(struct _adapter *padapter,
......
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