Skip to content

Commit

Permalink
staging: rtl8192e: Pass ieee80211_device to callbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mike McCormack authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent ad44d2a commit 1e04ca7
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 77 deletions.
22 changes: 11 additions & 11 deletions drivers/staging/rtl8192e/ieee80211/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2186,20 +2186,20 @@ struct ieee80211_device {
void (*stop_send_beacons) (struct ieee80211_device *dev);

/* power save mode related */
void (*sta_wake_up) (struct net_device *dev);
void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl);
short (*ps_is_queue_empty) (struct net_device *dev);
int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network);
int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network);
void (*sta_wake_up) (struct ieee80211_device *ieee80211);
void (*enter_sleep_state) (struct ieee80211_device *ieee80211, u32 th, u32 tl);
short (*ps_is_queue_empty) (struct ieee80211_device *ieee80211);
int (*handle_beacon) (struct ieee80211_device *ieee80211, struct ieee80211_beacon *beacon, struct ieee80211_network *network);
int (*handle_assoc_response) (struct ieee80211_device *ieee80211, struct ieee80211_assoc_response_frame *resp, struct ieee80211_network *network);

/* check whether Tx hw resouce available */
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
short (*check_nic_enough_desc)(struct ieee80211_device *ieee80211, int queue_index);
//added by wb for HT related
void (*SetBWModeHandler)(struct net_device *dev, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset);
bool (*GetNmodeSupportBySecCfg)(struct net_device* dev);
void (*SetWirelessMode)(struct net_device* dev, u8 wireless_mode);
bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device* dev);
void (*InitialGainHandler)(struct net_device *dev, u8 Operation);
void (*SetBWModeHandler)(struct ieee80211_device *ieee80211, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset);
bool (*GetNmodeSupportBySecCfg)(struct ieee80211_device *ieee80211);
void (*SetWirelessMode)(struct ieee80211_device *ieee80211, u8 wireless_mode);
bool (*GetHalfNmodeSupportByAPsHandler)(struct ieee80211_device *ieee80211);
void (*InitialGainHandler)(struct ieee80211_device *ieee80211, u8 Operation);

/* This must be the last item so that it points to the data
* allocated beyond this structure by alloc_ieee80211 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@ static inline void ieee80211_process_probe_response(
if (is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, &network, ieee)&&\
(ieee->state == IEEE80211_LINKED)) {
if(ieee->handle_beacon != NULL) {
ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
ieee->handle_beacon(ieee, beacon, &ieee->current_network);
}
}
}
Expand Down
28 changes: 14 additions & 14 deletions drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee
ieee->seq_ctrl[0]++;

/* check wether the managed packet queued greater than 5 */
if(!ieee->check_nic_enough_desc(ieee->dev,tcb_desc->queue_index)||\
(skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0)||\
if(!ieee->check_nic_enough_desc(ieee, tcb_desc->queue_index)||
(skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0)||
(ieee->queue_stop) ) {
/* insert the skb packet to the management queue */
/* as for the completion function, it does not need
Expand Down Expand Up @@ -1508,11 +1508,11 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee
if(ieee80211_is_54g(ieee->current_network) &&
(ieee->modulation & IEEE80211_OFDM_MODULATION)){
ieee->rate = 108;
ieee->SetWirelessMode(ieee->dev, IEEE_G);
ieee->SetWirelessMode(ieee, IEEE_G);
printk(KERN_INFO"Using G rates\n");
}else{
ieee->rate = 22;
ieee->SetWirelessMode(ieee->dev, IEEE_B);
ieee->SetWirelessMode(ieee, IEEE_B);
printk(KERN_INFO"Using B rates\n");
}
memset(ieee->dot11HTOperationalRateSet, 0, 16);
Expand Down Expand Up @@ -1845,13 +1845,13 @@ inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
}
if(sleep == 1){
if(ieee->sta_sleep == 1){
ieee->enter_sleep_state(ieee->dev,th,tl);
ieee->enter_sleep_state(ieee, th, tl);
}

else if(ieee->sta_sleep == 0){
spin_lock(&ieee->mgmt_tx_lock);

if(ieee->ps_is_queue_empty(ieee->dev)){
if (ieee->ps_is_queue_empty(ieee)) {
ieee->sta_sleep = 2;
ieee->ack_tx_to_ieee = 1;
ieee80211_sta_ps_send_null_frame(ieee,1);
Expand Down Expand Up @@ -1897,7 +1897,7 @@ void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl)
}

if(ieee->sta_sleep == 1)
ieee->sta_wake_up(ieee->dev);
ieee->sta_wake_up(ieee);
if(nl){

if(ieee->pHTInfo->IOTAction & HT_IOT_ACT_NULL_DATA_POWER_SAVING)
Expand Down Expand Up @@ -1929,7 +1929,7 @@ void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success)
/* Null frame with PS bit set */
if(success){
ieee->sta_sleep = 1;
ieee->enter_sleep_state(ieee->dev,ieee->ps_th,ieee->ps_tl);
ieee->enter_sleep_state(ieee, ieee->ps_th, ieee->ps_tl);
}
} else {/* 21112005 - tx again null without PS bit if lost */

Expand Down Expand Up @@ -2028,7 +2028,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, network->bssht.bdHTInfoLen);
}
if (ieee->handle_assoc_response != NULL)
ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame*)header, network);
ieee->handle_assoc_response(ieee, (struct ieee80211_assoc_response_frame*)header, network);
}
ieee80211_associate_complete(ieee);
} else {
Expand Down Expand Up @@ -2072,7 +2072,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
ieee->softmac_stats.rx_auth_rs_ok++;
if(!(ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE))
{
if (!ieee->GetNmodeSupportBySecCfg(ieee->dev))
if (!ieee->GetNmodeSupportBySecCfg(ieee))
{
// WEP or TKIP encryption
if(IsHTHalfNmodeAPs(ieee))
Expand All @@ -2091,12 +2091,12 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
/* Dummy wirless mode setting to avoid encryption issue */
if(bSupportNmode) {
//N mode setting
ieee->SetWirelessMode(ieee->dev, \
ieee->SetWirelessMode(ieee,
ieee->current_network.mode);
}else{
//b/g mode setting
/*TODO*/
ieee->SetWirelessMode(ieee->dev, IEEE_G);
ieee->SetWirelessMode(ieee, IEEE_G);
}

if (ieee->current_network.mode == IEEE_N_24G && bHalfSupportNmode == true)
Expand Down Expand Up @@ -2207,7 +2207,7 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *
#else
if ((skb_queue_len(&ieee->skb_waitQ[queue_index]) != 0) ||
#endif
(!ieee->check_nic_enough_desc(ieee->dev,queue_index))||\
(!ieee->check_nic_enough_desc(ieee, queue_index))||
(ieee->queue_stop)) {
/* insert the skb packet to the wait queue */
/* as for the completion function, it does not need
Expand Down Expand Up @@ -2457,7 +2457,7 @@ void ieee80211_start_ibss_wq(struct work_struct *work)

// By default, WMM function will be disabled in IBSS mode
ieee->current_network.QoS_Enable = 0;
ieee->SetWirelessMode(ieee->dev, IEEE_G);
ieee->SetWirelessMode(ieee, IEEE_G);
ieee->current_network.atim_window = 0;
ieee->current_network.capability = WLAN_CAPABILITY_IBSS;
if(ieee->short_slot)
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,13 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)

ieee->state = IEEE80211_LINKED_SCANNING;
ieee->link_change(ieee);
ieee->InitialGainHandler(ieee->dev,IG_Backup);
ieee->InitialGainHandler(ieee, IG_Backup);
if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT && ieee->pHTInfo->bCurBW40MHz) {
b40M = 1;
chan_offset = ieee->pHTInfo->CurSTAExtChnlOffset;
bandwidth = (HT_CHANNEL_WIDTH)ieee->pHTInfo->bCurBW40MHz;
printk("Scan in 40M, force to 20M first:%d, %d\n", chan_offset, bandwidth);
ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
ieee->SetBWModeHandler(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
}
ieee80211_start_scan_syncro(ieee);
if (b40M) {
Expand All @@ -339,12 +339,12 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->set_chan(ieee, chan - 2);
else
ieee->set_chan(ieee, chan);
ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset);
ieee->SetBWModeHandler(ieee, bandwidth, chan_offset);
} else {
ieee->set_chan(ieee, chan);
}

ieee->InitialGainHandler(ieee->dev,IG_Restore);
ieee->InitialGainHandler(ieee, IG_Restore);
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee);

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* s


#if 1
if(!ieee->GetNmodeSupportBySecCfg(ieee->dev))
if (!ieee->GetNmodeSupportBySecCfg(ieee))
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192e/ieee80211/rtl819x_BAProc.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ int ieee80211_rx_ADDBAReq( struct ieee80211_device* ieee, struct sk_buff *skb)
pBA->BaTimeoutValue = *pBaTimeoutVal;
pBA->BaStartSeqCtrl = *pBaStartSeqCtrl;
//for half N mode we only aggregate 1 frame
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
pBA->BaParamSet.field.BufferSize = 1;
else
pBA->BaParamSet.field.BufferSize = 32;
Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/rtl8192e/ieee80211/rtl819x_HTProc.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ bool IsHTHalfNmode40Bandwidth(struct ieee80211_device* ieee)
retValue = false;
else if(pHTInfo->bRegBW40MHz == false) // station supports 40 bw
retValue = false;
else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode
else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee)) // station in half n mode
retValue = false;
else if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw
retValue = true;
Expand All @@ -240,7 +240,7 @@ bool IsHTHalfNmodeSGI(struct ieee80211_device* ieee, bool is40MHz)

if(pHTInfo->bCurrentHTSupport == false ) // wireless is n mode
retValue = false;
else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode
else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee)) // station in half n mode
retValue = false;
else if(is40MHz) // ap support 40 bw
{
Expand Down Expand Up @@ -652,7 +652,7 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u

//HT capability info
pCapELE->AdvCoding = 0; // This feature is not supported now!!
if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
{
pCapELE->ChlWidth = 0;
}
Expand Down Expand Up @@ -705,7 +705,7 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u

// 2008.06.12
// For RTL819X, if pairwisekey = wep/tkip, ap is ralink, we support only MCS0~7.
if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
{
int i;
for(i = 1; i< 16; i++)
Expand Down Expand Up @@ -993,7 +993,7 @@ u8 HTFilterMCSRate( struct ieee80211_device* ieee, u8* pSupportMCS, u8* pOperate
HT_PickMCSRate(ieee, pOperateMCS);

// For RTL819X, if pairwisekey = wep/tkip, we support only MCS0~7.
if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
pOperateMCS[1] = 0;

//
Expand Down Expand Up @@ -1679,7 +1679,7 @@ void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidt
return;
}
//if in half N mode, set to 20M bandwidth please 09.08.2008 WB.
if(Bandwidth==HT_CHANNEL_WIDTH_20_40 && (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)))
if (Bandwidth==HT_CHANNEL_WIDTH_20_40 && (!ieee->GetHalfNmodeSupportByAPsHandler(ieee)))
{
// Handle Illegal extention channel offset!!
if(ieee->current_network.channel<2 && Offset==HT_EXTCHNL_OFFSET_LOWER)
Expand Down Expand Up @@ -1722,10 +1722,10 @@ void HTSetConnectBwModeCallback(struct ieee80211_device* ieee)
else
ieee->set_chan(ieee, ieee->current_network.channel);

ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset);
ieee->SetBWModeHandler(ieee, HT_CHANNEL_WIDTH_20_40, pHTInfo->CurSTAExtChnlOffset);
} else {
ieee->set_chan(ieee, ieee->current_network.channel);
ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
ieee->SetBWModeHandler(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
}

pHTInfo->bSwBwInProgress = false;
Expand Down
Loading

0 comments on commit 1e04ca7

Please sign in to comment.