staging: rtl8192e: Pass ieee80211_device to callbacks

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Mike McCormack 2011-03-10 22:33:36 +09:00 committed by Greg Kroah-Hartman
parent 45a43a84cd
commit 09145962d6
10 changed files with 62 additions and 60 deletions

View File

@ -2124,7 +2124,7 @@ struct ieee80211_device {
* This fucntion can't sleep.
*/
int (*softmac_hard_start_xmit)(struct sk_buff *skb,
struct net_device *dev);
struct ieee80211_device *ieee80211);
/* used instead of hard_start_xmit (not softmac_hard_start_xmit)
* if the IEEE_SOFTMAC_TX_QUEUE feature is used to TX data
@ -2133,22 +2133,22 @@ struct ieee80211_device {
* This function can't sleep.
*/
void (*softmac_data_hard_start_xmit)(struct sk_buff *skb,
struct net_device *dev,int rate);
struct ieee80211_device *ieee80211, int rate);
/* stops the HW queue for DATA frames. Useful to avoid
* waste time to TX data frame when we are reassociating
* This function can sleep.
*/
void (*data_hard_stop)(struct net_device *dev);
void (*data_hard_stop)(struct ieee80211_device *ieee80211);
/* OK this is complementar to data_poll_hard_stop */
void (*data_hard_resume)(struct net_device *dev);
void (*data_hard_resume)(struct ieee80211_device *ieee80211);
/* ask to the driver to retune the radio .
* This function can sleep. the driver should ensure
* the radio has been swithced before return.
*/
void (*set_chan)(struct net_device *dev,short ch);
void (*set_chan)(struct ieee80211_device *ieee80211, short ch);
/* These are not used if the ieee stack takes care of
* scanning (IEEE_SOFTMAC_SCAN feature set).
@ -2182,8 +2182,8 @@ struct ieee80211_device {
* stop_send_bacons is NOT guaranteed to be called only
* after start_send_beacons.
*/
void (*start_send_beacons) (struct net_device *dev);
void (*stop_send_beacons) (struct net_device *dev);
void (*start_send_beacons) (struct ieee80211_device *dev);
void (*stop_send_beacons) (struct ieee80211_device *dev);
/* power save mode related */
void (*sta_wake_up) (struct net_device *dev);

View File

@ -243,7 +243,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee
ieee->seq_ctrl[0]++;
/* avoid watchdog triggers */
ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate);
ieee->softmac_data_hard_start_xmit(skb, ieee, ieee->basic_rate);
}
spin_unlock_irqrestore(&ieee->lock, flags);
@ -268,7 +268,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee
* */
skb_queue_tail(&ieee->skb_waitQ[tcb_desc->queue_index], skb);
} else {
ieee->softmac_hard_start_xmit(skb,ieee->dev);
ieee->softmac_hard_start_xmit(skb, ieee);
}
spin_unlock(&ieee->mgmt_tx_lock);
}
@ -297,7 +297,7 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *i
ieee->seq_ctrl[0]++;
/* avoid watchdog triggers */
ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate);
ieee->softmac_data_hard_start_xmit(skb, ieee, ieee->basic_rate);
}else{
@ -308,7 +308,7 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *i
else
ieee->seq_ctrl[0]++;
ieee->softmac_hard_start_xmit(skb,ieee->dev);
ieee->softmac_hard_start_xmit(skb, ieee);
}
}
@ -448,7 +448,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
if (ieee->state == IEEE80211_LINKED)
goto out;
ieee->set_chan(ieee->dev, ch);
ieee->set_chan(ieee, ch);
#ifdef ENABLE_DOT11D
if(channel_map[ch] == 1)
#endif
@ -517,7 +517,7 @@ void ieee80211_softmac_scan_wq(struct work_struct *work)
#endif
if (ieee->scanning == 0 )
goto out;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
ieee->set_chan(ieee, ieee->current_network.channel);
#ifdef ENABLE_DOT11D
if(channel_map[ieee->current_network.channel] == 1)
#endif
@ -568,7 +568,7 @@ void ieee80211_beacons_stop(struct ieee80211_device *ieee)
void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
{
if(ieee->stop_send_beacons)
ieee->stop_send_beacons(ieee->dev);
ieee->stop_send_beacons(ieee);
if (ieee->softmac_features & IEEE_SOFTMAC_BEACONS)
ieee80211_beacons_stop(ieee);
}
@ -577,7 +577,7 @@ void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
void ieee80211_start_send_beacons(struct ieee80211_device *ieee)
{
if(ieee->start_send_beacons)
ieee->start_send_beacons(ieee->dev);
ieee->start_send_beacons(ieee);
if(ieee->softmac_features & IEEE_SOFTMAC_BEACONS)
ieee80211_beacons_start(ieee);
}
@ -1390,7 +1390,7 @@ void ieee80211_associate_complete_wq(struct work_struct *work)
}
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
ieee->data_hard_resume(ieee);
netif_carrier_on(ieee->dev);
}
@ -1414,7 +1414,7 @@ void ieee80211_associate_procedure_wq(struct work_struct *work)
down(&ieee->wx_sem);
if (ieee->data_hard_stop)
ieee->data_hard_stop(ieee->dev);
ieee->data_hard_stop(ieee);
ieee80211_stop_scan(ieee);
printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel);
@ -2221,7 +2221,7 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *
}else{
ieee->softmac_data_hard_start_xmit(
txb->fragments[i],
ieee->dev,ieee->rate);
ieee, ieee->rate);
}
}
@ -2244,7 +2244,7 @@ void ieee80211_resume_tx(struct ieee80211_device *ieee)
ieee->softmac_data_hard_start_xmit(
ieee->tx_pending.txb->fragments[i],
ieee->dev,ieee->rate);
ieee, ieee->rate);
ieee->stats.tx_packets++;
}
}
@ -2294,7 +2294,7 @@ void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
else
ieee->seq_ctrl[0]++;
ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate);
ieee->softmac_data_hard_start_xmit(skb, ieee, ieee->basic_rate);
}
}
if (!ieee->queue_stop && ieee->tx_pending.txb)
@ -2348,13 +2348,13 @@ void ieee80211_start_master_bss(struct ieee80211_device *ieee)
memcpy(ieee->current_network.bssid, ieee->dev->dev_addr, ETH_ALEN);
ieee->set_chan(ieee->dev, ieee->current_network.channel);
ieee->set_chan(ieee, ieee->current_network.channel);
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
notify_wx_assoc_event(ieee);
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
ieee->data_hard_resume(ieee);
netif_carrier_on(ieee->dev);
}
@ -2364,7 +2364,7 @@ void ieee80211_start_monitor_mode(struct ieee80211_device *ieee)
if(ieee->raw_tx){
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
ieee->data_hard_resume(ieee);
netif_carrier_on(ieee->dev);
}
@ -2467,7 +2467,7 @@ void ieee80211_start_ibss_wq(struct work_struct *work)
ieee->state = IEEE80211_LINKED;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
ieee->set_chan(ieee, ieee->current_network.channel);
ieee->link_change(ieee->dev);
notify_wx_assoc_event(ieee);
@ -2475,7 +2475,7 @@ void ieee80211_start_ibss_wq(struct work_struct *work)
ieee80211_start_send_beacons(ieee);
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
ieee->data_hard_resume(ieee);
netif_carrier_on(ieee->dev);
up(&ieee->wx_sem);
@ -2540,7 +2540,7 @@ void ieee80211_disassociate(struct ieee80211_device *ieee)
ieee80211_reset_queue(ieee);
if (ieee->data_hard_stop)
ieee->data_hard_stop(ieee->dev);
ieee->data_hard_stop(ieee);
#ifdef ENABLE_DOT11D
if(IS_DOT11D_ENABLE(ieee))
Dot11d_Reset(ieee);

View File

@ -316,7 +316,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
#endif
if (ieee->data_hard_stop)
ieee->data_hard_stop(ieee->dev);
ieee->data_hard_stop(ieee);
ieee80211_stop_send_beacons(ieee);
@ -360,7 +360,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
}
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
ieee->data_hard_resume(ieee);
if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
ieee80211_start_send_beacons(ieee);
@ -479,7 +479,7 @@ out:
{
if(prev == 0 && ieee->raw_tx){
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
ieee->data_hard_resume(ieee);
netif_carrier_on(ieee->dev);
}

View File

@ -1716,15 +1716,15 @@ void HTSetConnectBwModeCallback(struct ieee80211_device* ieee)
if(pHTInfo->bCurBW40MHz)
{
if(pHTInfo->CurSTAExtChnlOffset==HT_EXTCHNL_OFFSET_UPPER)
ieee->set_chan(ieee->dev, ieee->current_network.channel+2);
ieee->set_chan(ieee, ieee->current_network.channel+2);
else if(pHTInfo->CurSTAExtChnlOffset==HT_EXTCHNL_OFFSET_LOWER)
ieee->set_chan(ieee->dev, ieee->current_network.channel-2);
ieee->set_chan(ieee, ieee->current_network.channel-2);
else
ieee->set_chan(ieee->dev, ieee->current_network.channel);
ieee->set_chan(ieee, ieee->current_network.channel);
ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset);
} else {
ieee->set_chan(ieee->dev, ieee->current_network.channel);
ieee->set_chan(ieee, ieee->current_network.channel);
ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
}

View File

@ -916,8 +916,8 @@ typedef struct r8192_priv
struct semaphore rf_sem; //used to lock rf write operation added by wb, modified by david
u8 rf_type; /* 0 means 1T2R, 1 means 2T4R */
short (*rf_set_sens)(struct net_device *dev,short sens);
u8 (*rf_set_chan)(struct net_device *dev,u8 ch);
short (*rf_set_sens)(struct net_device *dev, short sens);
u8 (*rf_set_chan)(struct ieee80211_device *ieee80211, u8 ch);
short promisc;
/* stats */
struct Stats stats;

View File

@ -96,8 +96,8 @@ static struct pci_driver rtl8192_pci_driver = {
#endif
};
static void rtl8192_start_beacon(struct net_device *dev);
static void rtl8192_stop_beacon(struct net_device *dev);
static void rtl8192_start_beacon(struct ieee80211_device *ieee80211);
static void rtl8192_stop_beacon(struct ieee80211_device *ieee80211);
static void rtl819x_watchdog_wqcallback(struct work_struct *work);
static void rtl8192_irq_rx_tasklet(unsigned long arg);
static void rtl8192_irq_tx_tasklet(unsigned long arg);
@ -648,16 +648,16 @@ static void rtl8192_update_msr(struct r8192_priv *priv)
write_nic_byte(priv, MSR, msr);
}
static void rtl8192_set_chan(struct net_device *dev,short ch)
static void rtl8192_set_chan(struct ieee80211_device *ieee80211, short ch)
{
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
priv->chan = ch;
/* need to implement rf set channel here WB */
if (priv->rf_set_chan)
priv->rf_set_chan(dev, priv->chan);
priv->rf_set_chan(ieee80211, priv->chan);
}
static void rtl8192_rx_enable(struct r8192_priv *priv)
@ -803,11 +803,11 @@ static void rtl8192_halt_adapter(struct r8192_priv *priv, bool reset)
skb_queue_purge(&priv->skb_queue);
}
static void rtl8192_data_hard_stop(struct net_device *dev)
static void rtl8192_data_hard_stop(struct ieee80211_device *ieee80211)
{
}
static void rtl8192_data_hard_resume(struct net_device *dev)
static void rtl8192_data_hard_resume(struct ieee80211_device *ieee80211)
{
}
@ -815,9 +815,10 @@ static void rtl8192_data_hard_resume(struct net_device *dev)
* this function TX data frames when the ieee80211 stack requires this.
* It checks also if we need to stop the ieee tx queue, eventually do it
*/
static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int rate)
static void rtl8192_hard_data_xmit(struct sk_buff *skb,
struct ieee80211_device *ieee80211, int rate)
{
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
int ret;
cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index;
@ -831,7 +832,7 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
return;
}
memcpy(skb->cb, &dev, sizeof(dev));
memcpy(skb->cb, &ieee80211->dev, sizeof(ieee80211->dev));
skb_push(skb, priv->ieee80211->tx_headroom);
ret = rtl8192_tx(priv, skb);
@ -851,9 +852,9 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
* If the ring is full packet are dropped (for data frame the queue
* is stopped before this can happen).
*/
static int rtl8192_hard_start_xmit(struct sk_buff *skb,struct net_device *dev)
static int rtl8192_hard_start_xmit(struct sk_buff *skb, struct ieee80211_device *ieee80211)
{
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
int ret;
cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index;
@ -866,7 +867,7 @@ static int rtl8192_hard_start_xmit(struct sk_buff *skb,struct net_device *dev)
}
}
memcpy(skb->cb, &dev, sizeof(dev));
memcpy(skb->cb, &ieee80211->dev, sizeof(ieee80211->dev));
if (queue_index == TXCMD_QUEUE) {
rtl819xE_tx_cmd(priv, skb);
ret = 0;
@ -876,7 +877,7 @@ static int rtl8192_hard_start_xmit(struct sk_buff *skb,struct net_device *dev)
tcb_desc->bTxDisableRateFallBack = 1;
tcb_desc->bTxUseDriverAssingedRate = 1;
tcb_desc->bTxEnableFwCalcDur = 1;
skb_push(skb, priv->ieee80211->tx_headroom);
skb_push(skb, ieee80211->tx_headroom);
ret = rtl8192_tx(priv, skb);
if (ret != 0) {
kfree_skb(skb);
@ -918,7 +919,7 @@ static void rtl8192_tx_isr(struct r8192_priv *priv, int prio)
}
}
static void rtl8192_stop_beacon(struct net_device *dev)
static void rtl8192_stop_beacon(struct ieee80211_device *ieee80211)
{
}
@ -1927,8 +1928,8 @@ static void rtl8192_init_priv_variable(struct r8192_priv *priv)
priv->ieee80211->modulation = IEEE80211_CCK_MODULATION | IEEE80211_OFDM_MODULATION;
priv->ieee80211->host_encrypt = 1;
priv->ieee80211->host_decrypt = 1;
priv->ieee80211->start_send_beacons = rtl8192_start_beacon;//+by david 081107
priv->ieee80211->stop_send_beacons = rtl8192_stop_beacon;//+by david 081107
priv->ieee80211->start_send_beacons = rtl8192_start_beacon;
priv->ieee80211->stop_send_beacons = rtl8192_stop_beacon;
priv->ieee80211->softmac_hard_start_xmit = rtl8192_hard_start_xmit;
priv->ieee80211->set_chan = rtl8192_set_chan;
priv->ieee80211->link_change = rtl8192_link_change;
@ -2853,9 +2854,9 @@ static void rtl8192_prepare_beacon(unsigned long arg)
* rtl8192_beacon_tx_enable(). rtl8192_beacon_tx_disable() might
* be used to stop beacon transmission
*/
static void rtl8192_start_beacon(struct net_device *dev)
static void rtl8192_start_beacon(struct ieee80211_device *ieee80211)
{
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
struct ieee80211_network *net = &priv->ieee80211->current_network;
u16 BcnTimeCfg = 0;
u16 BcnCW = 6;
@ -4306,7 +4307,7 @@ static void rtl8192_tx_resume(struct r8192_priv *priv)
/* 1. dequeue the packet from the wait queue */
skb = skb_dequeue(&ieee->skb_waitQ[i]);
/* 2. tx the packet directly */
ieee->softmac_data_hard_start_xmit(skb, dev, 0);
ieee->softmac_data_hard_start_xmit(skb, ieee, 0);
}
}
}

View File

@ -104,7 +104,7 @@ RT_STATUS cmpk_message_handle_tx(
*seg_ptr++ = ((i+3)<frag_length)?code_virtual_address[i+0]:0;
}
skb_put(skb, i);
priv->ieee80211->softmac_hard_start_xmit(skb,dev);
priv->ieee80211->softmac_hard_start_xmit(skb, priv->ieee80211);
code_virtual_address += frag_length;
frag_offset += frag_length;

View File

@ -96,7 +96,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
}
tcb_desc->txbuf_size = (u16)i;
skb_put(skb, i);
priv->ieee80211->softmac_hard_start_xmit(skb, dev);
priv->ieee80211->softmac_hard_start_xmit(skb, priv->ieee80211);
code_virtual_address += frag_length;
frag_offset += frag_length;

View File

@ -1850,9 +1850,10 @@ void rtl8192_SwChnl_WorkItem(struct r8192_priv *priv)
* return: return code show if workitem is scheduled(1:pass, 0:fail)
* Note: Delay may be required for RF configuration
* ***************************************************************************/
u8 rtl8192_phy_SwChnl(struct net_device* dev, u8 channel)
u8 rtl8192_phy_SwChnl(struct ieee80211_device *ieee80211, u8 channel)
{
struct r8192_priv *priv = ieee80211_priv(dev);
struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
RT_TRACE(COMP_PHY, "=====>%s()\n", __FUNCTION__);
if(!priv->up)
return false;

View File

@ -117,7 +117,7 @@ void rtl8192_phy_updateInitGain(struct r8192_priv *priv);
u8 rtl8192_phy_ConfigRFWithHeaderFile(struct r8192_priv *priv,
RF90_RADIO_PATH_E eRFPath);
u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel);
u8 rtl8192_phy_SwChnl(struct ieee80211_device *ieee80211, u8 channel);
void rtl8192_SetBWMode(struct net_device *dev,
HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset);