staging: rtl8187se: Remove unnecessary blank lines

Remove unnecessary blank lines in ieee80211/ieee80211_softmac.c
(and add some necessary blank lines).

Signed-off-by: Ana Rey <anarey@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
This commit is contained in:
Ana Rey 2014-03-16 20:44:22 +01:00 committed by Peter P Waskiewicz Jr
parent 97a0e1f900
commit 9cc8a29dfd

View File

@ -13,7 +13,6 @@
* released under the GPL * released under the GPL
*/ */
#include "ieee80211.h" #include "ieee80211.h"
#include <linux/random.h> #include <linux/random.h>
@ -79,7 +78,6 @@ static void ieee80211_MFIE_Grate(struct ieee80211_device *ieee, u8 **tag_p)
u8 *tag = *tag_p; u8 *tag = *tag_p;
if (ieee->modulation & IEEE80211_OFDM_MODULATION){ if (ieee->modulation & IEEE80211_OFDM_MODULATION){
*tag++ = MFIE_TYPE_RATES_EX; *tag++ = MFIE_TYPE_RATES_EX;
*tag++ = 8; *tag++ = 8;
*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_6MB; *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_6MB;
@ -92,12 +90,10 @@ static void ieee80211_MFIE_Grate(struct ieee80211_device *ieee, u8 **tag_p)
*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB; *tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB;
} }
/* We may add an option for custom rates that specific HW might support */ /* We may add an option for custom rates that specific HW might support */
*tag_p = tag; *tag_p = tag;
} }
static void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p) static void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p)
{ {
u8 *tag = *tag_p; u8 *tag = *tag_p;
@ -166,7 +162,6 @@ static void init_mgmt_queue(struct ieee80211_device *ieee)
ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0; ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0;
} }
void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl); void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl);
inline void softmac_mgmt_xmit(struct sk_buff *skb, inline void softmac_mgmt_xmit(struct sk_buff *skb,
@ -177,7 +172,6 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb,
struct ieee80211_hdr_3addr *header= struct ieee80211_hdr_3addr *header=
(struct ieee80211_hdr_3addr *) skb->data; (struct ieee80211_hdr_3addr *) skb->data;
spin_lock_irqsave(&ieee->lock, flags); spin_lock_irqsave(&ieee->lock, flags);
/* called with 2nd param 0, no mgmt lock required */ /* called with 2nd param 0, no mgmt lock required */
@ -185,7 +179,6 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb,
if(single){ if(single){
if(ieee->queue_stop){ if(ieee->queue_stop){
enqueue_mgmt(ieee,skb); enqueue_mgmt(ieee,skb);
}else{ }else{
header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0]<<4); header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0]<<4);
@ -220,18 +213,14 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb,
} }
} }
inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
struct ieee80211_device *ieee) struct ieee80211_device *ieee)
{ {
short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE; short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
struct ieee80211_hdr_3addr *header = struct ieee80211_hdr_3addr *header =
(struct ieee80211_hdr_3addr *) skb->data; (struct ieee80211_hdr_3addr *) skb->data;
if(single){ if(single){
header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4); header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
if (ieee->seq_ctrl[0] == 0xFFF) if (ieee->seq_ctrl[0] == 0xFFF)
@ -242,9 +231,7 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
/* avoid watchdog triggers */ /* avoid watchdog triggers */
ieee->dev->trans_start = jiffies; ieee->dev->trans_start = jiffies;
ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate); ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate);
}else{ }else{
header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4); header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
if (ieee->seq_ctrl[0] == 0xFFF) if (ieee->seq_ctrl[0] == 0xFFF)
@ -255,9 +242,9 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
/* avoid watchdog triggers */ /* avoid watchdog triggers */
ieee->dev->trans_start = jiffies; ieee->dev->trans_start = jiffies;
ieee->softmac_hard_start_xmit(skb,ieee->dev); ieee->softmac_hard_start_xmit(skb,ieee->dev);
} }
} }
inline struct sk_buff * inline struct sk_buff *
ieee80211_disassociate_skb(struct ieee80211_network *beacon, ieee80211_disassociate_skb(struct ieee80211_network *beacon,
struct ieee80211_device *ieee, u8 asRsn) struct ieee80211_device *ieee, u8 asRsn)
@ -280,6 +267,7 @@ ieee80211_disassociate_skb(struct ieee80211_network *beacon,
disass->reasoncode = asRsn; disass->reasoncode = asRsn;
return skb; return skb;
} }
void SendDisassociation(struct ieee80211_device *ieee, u8 *asSta, u8 asRsn) void SendDisassociation(struct ieee80211_device *ieee, u8 *asSta, u8 asRsn)
{ {
struct ieee80211_network *beacon = &ieee->current_network; struct ieee80211_network *beacon = &ieee->current_network;
@ -409,7 +397,6 @@ static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
while(1) while(1)
{ {
do{ do{
ch++; ch++;
if (ch > MAX_CHANNEL_NUMBER) if (ch > MAX_CHANNEL_NUMBER)
@ -449,9 +436,7 @@ static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
if (ieee->sync_scan_hurryup) if (ieee->sync_scan_hurryup)
goto out; goto out;
msleep_interruptible_rtl(IEEE80211_SOFTMAC_SCAN_TIME); msleep_interruptible_rtl(IEEE80211_SOFTMAC_SCAN_TIME);
} }
out: out:
ieee->sync_scan_hurryup = 0; ieee->sync_scan_hurryup = 0;
@ -532,7 +517,6 @@ static void ieee80211_softmac_scan_wq(struct work_struct *work)
(ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER; (ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER;
if (watchdog++ > MAX_CHANNEL_NUMBER) if (watchdog++ > MAX_CHANNEL_NUMBER)
goto out; /* no good chans */ goto out; /* no good chans */
}while(!channel_map[ieee->current_network.channel]); }while(!channel_map[ieee->current_network.channel]);
if (ieee->scanning == 0 ) if (ieee->scanning == 0 )
@ -580,10 +564,8 @@ static void ieee80211_beacons_stop(struct ieee80211_device *ieee)
del_timer_sync(&ieee->beacon_timer); del_timer_sync(&ieee->beacon_timer);
spin_unlock_irqrestore(&ieee->beacon_lock,flags); spin_unlock_irqrestore(&ieee->beacon_lock,flags);
} }
void ieee80211_stop_send_beacons(struct ieee80211_device *ieee) void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
{ {
if(ieee->stop_send_beacons) if(ieee->stop_send_beacons)
@ -592,7 +574,6 @@ void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
ieee80211_beacons_stop(ieee); ieee80211_beacons_stop(ieee);
} }
void ieee80211_start_send_beacons(struct ieee80211_device *ieee) void ieee80211_start_send_beacons(struct ieee80211_device *ieee)
{ {
if(ieee->start_send_beacons) if(ieee->start_send_beacons)
@ -601,7 +582,6 @@ void ieee80211_start_send_beacons(struct ieee80211_device *ieee)
ieee80211_beacons_start(ieee); ieee80211_beacons_start(ieee);
} }
static void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee) static void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee)
{ {
down(&ieee->scan_sem); down(&ieee->scan_sem);
@ -642,7 +622,6 @@ void ieee80211_rtl_start_scan(struct ieee80211_device *ieee)
} }
}else }else
ieee->start_scan(ieee->dev); ieee->start_scan(ieee->dev);
} }
/* called with wx_sem held */ /* called with wx_sem held */
@ -661,7 +640,6 @@ void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
ieee80211_softmac_scan_syncro(ieee); ieee80211_softmac_scan_syncro(ieee);
else else
ieee->scan_syncro(ieee->dev); ieee->scan_syncro(ieee->dev);
} }
inline struct sk_buff * inline struct sk_buff *
@ -695,7 +673,6 @@ ieee80211_authentication_req(struct ieee80211_network *beacon,
auth->status = cpu_to_le16(WLAN_STATUS_SUCCESS); auth->status = cpu_to_le16(WLAN_STATUS_SUCCESS);
return skb; return skb;
} }
static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
@ -813,7 +790,6 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len); memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
} }
skb->dev = ieee->dev; skb->dev = ieee->dev;
return skb; return skb;
} }
@ -846,7 +822,6 @@ static struct sk_buff *ieee80211_assoc_resp(struct ieee80211_device *ieee,
assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ? assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ?
WLAN_CAPABILITY_BSS : WLAN_CAPABILITY_IBSS); WLAN_CAPABILITY_BSS : WLAN_CAPABILITY_IBSS);
if(ieee->short_slot) if(ieee->short_slot)
assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT); assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
@ -896,8 +871,6 @@ static struct sk_buff *ieee80211_auth_resp(struct ieee80211_device *ieee,
memcpy(auth->header.addr1, dest, ETH_ALEN); memcpy(auth->header.addr1, dest, ETH_ALEN);
auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH); auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
return skb; return skb;
} }
static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee, short pwr) static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee, short pwr)
@ -921,11 +894,8 @@ static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee, short
(pwr ? IEEE80211_FCTL_PM:0)); (pwr ? IEEE80211_FCTL_PM:0));
return skb; return skb;
} }
static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest) static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
{ {
struct sk_buff *buf = ieee80211_assoc_resp(ieee, dest); struct sk_buff *buf = ieee80211_assoc_resp(ieee, dest);
@ -936,7 +906,6 @@ static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
} }
} }
static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *dest) static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *dest)
{ {
struct sk_buff *buf = ieee80211_auth_resp(ieee, s, dest); struct sk_buff *buf = ieee80211_auth_resp(ieee, s, dest);
@ -947,10 +916,8 @@ static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *des
} }
} }
static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest) static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
{ {
struct sk_buff *buf = ieee80211_probe_resp(ieee, dest); struct sk_buff *buf = ieee80211_probe_resp(ieee, dest);
if (buf) { if (buf) {
@ -959,7 +926,6 @@ static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
} }
} }
inline struct sk_buff * inline struct sk_buff *
ieee80211_association_req(struct ieee80211_network *beacon, ieee80211_association_req(struct ieee80211_network *beacon,
struct ieee80211_device *ieee) struct ieee80211_device *ieee)
@ -1007,7 +973,6 @@ ieee80211_association_req(struct ieee80211_network *beacon,
hdr = (struct ieee80211_assoc_request_frame *) hdr = (struct ieee80211_assoc_request_frame *)
skb_put(skb, sizeof(struct ieee80211_assoc_request_frame)); skb_put(skb, sizeof(struct ieee80211_assoc_request_frame));
hdr->header.frame_control = IEEE80211_STYPE_ASSOC_REQ; hdr->header.frame_control = IEEE80211_STYPE_ASSOC_REQ;
hdr->header.duration_id= 37; //FIXME hdr->header.duration_id= 37; //FIXME
memcpy(hdr->header.addr1, beacon->bssid, ETH_ALEN); memcpy(hdr->header.addr1, beacon->bssid, ETH_ALEN);
@ -1051,13 +1016,11 @@ ieee80211_association_req(struct ieee80211_network *beacon,
if(turbo_info_len) { if(turbo_info_len) {
ieee80211_TURBO_Info(ieee, &tag); ieee80211_TURBO_Info(ieee, &tag);
} }
return skb; return skb;
} }
void ieee80211_associate_abort(struct ieee80211_device *ieee) void ieee80211_associate_abort(struct ieee80211_device *ieee)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&ieee->lock, flags); spin_lock_irqsave(&ieee->lock, flags);
@ -1089,7 +1052,6 @@ static void ieee80211_associate_abort_cb(unsigned long dev)
ieee80211_associate_abort((struct ieee80211_device *) dev); ieee80211_associate_abort((struct ieee80211_device *) dev);
} }
static void ieee80211_associate_step1(struct ieee80211_device *ieee) static void ieee80211_associate_step1(struct ieee80211_device *ieee)
{ {
struct ieee80211_network *beacon = &ieee->current_network; struct ieee80211_network *beacon = &ieee->current_network;
@ -1099,7 +1061,6 @@ static void ieee80211_associate_step1(struct ieee80211_device *ieee)
ieee->softmac_stats.tx_auth_rq++; ieee->softmac_stats.tx_auth_rq++;
skb=ieee80211_authentication_req(beacon, ieee, 0); skb=ieee80211_authentication_req(beacon, ieee, 0);
if (!skb){ if (!skb){
ieee80211_associate_abort(ieee); ieee80211_associate_abort(ieee);
} }
else{ else{
@ -1177,7 +1138,6 @@ static void ieee80211_associate_complete_wq(struct work_struct *work)
printk(KERN_INFO "Associated successfully\n"); printk(KERN_INFO "Associated successfully\n");
if(ieee80211_is_54g(&ieee->current_network) && if(ieee80211_is_54g(&ieee->current_network) &&
(ieee->modulation & IEEE80211_OFDM_MODULATION)){ (ieee->modulation & IEEE80211_OFDM_MODULATION)){
ieee->rate = 540; ieee->rate = 540;
printk(KERN_INFO"Using G rates\n"); printk(KERN_INFO"Using G rates\n");
}else{ }else{
@ -1240,7 +1200,6 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
if ((ieee->iw_mode == IW_MODE_ADHOC) && !(net->capability & WLAN_CAPABILITY_IBSS)) if ((ieee->iw_mode == IW_MODE_ADHOC) && !(net->capability & WLAN_CAPABILITY_IBSS))
return; return;
if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC){ if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC){
/* if the user specified the AP MAC, we need also the essid /* if the user specified the AP MAC, we need also the essid
* This could be obtained by beacons or, if the network does not * This could be obtained by beacons or, if the network does not
@ -1268,8 +1227,6 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
*/ */
(!apset && ssidset && ssidbroad && ssidmatch) (!apset && ssidset && ssidbroad && ssidmatch)
){ ){
/* if the essid is hidden replace it with the /* if the essid is hidden replace it with the
* essid provided by the user. * essid provided by the user.
*/ */
@ -1301,10 +1258,8 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
ieee->state = IEEE80211_LINKED; ieee->state = IEEE80211_LINKED;
ieee->beinretry = false; ieee->beinretry = false;
} }
} }
} }
} }
void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee) void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee)
@ -1314,23 +1269,18 @@ void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee)
spin_lock_irqsave(&ieee->lock, flags); spin_lock_irqsave(&ieee->lock, flags);
list_for_each_entry(target, &ieee->network_list, list) { list_for_each_entry(target, &ieee->network_list, list) {
/* if the state become different that NOLINK means /* if the state become different that NOLINK means
* we had found what we are searching for * we had found what we are searching for
*/ */
if (ieee->state != IEEE80211_NOLINK) if (ieee->state != IEEE80211_NOLINK)
break; break;
if (ieee->scan_age == 0 || time_after(target->last_scanned + ieee->scan_age, jiffies)) if (ieee->scan_age == 0 || time_after(target->last_scanned + ieee->scan_age, jiffies))
ieee80211_softmac_new_net(ieee, target); ieee80211_softmac_new_net(ieee, target);
} }
spin_unlock_irqrestore(&ieee->lock, flags); spin_unlock_irqrestore(&ieee->lock, flags);
} }
static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen) static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen)
{ {
struct ieee80211_authentication *a; struct ieee80211_authentication *a;
@ -1351,12 +1301,9 @@ static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen)
return -ENOMEM; return -ENOMEM;
} }
} }
return cpu_to_le16(a->status); return cpu_to_le16(a->status);
} }
static int auth_rq_parse(struct sk_buff *skb, u8 *dest) static int auth_rq_parse(struct sk_buff *skb, u8 *dest)
{ {
struct ieee80211_authentication *a; struct ieee80211_authentication *a;
@ -1467,7 +1414,6 @@ inline void ieee80211_rx_auth_rq(struct ieee80211_device *ieee,
if (status != -1) { if (status != -1) {
ieee80211_resp_to_auth(ieee, status, dest); ieee80211_resp_to_auth(ieee, status, dest);
} }
} }
inline void inline void
@ -1484,19 +1430,14 @@ ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
printk(KERN_INFO"New client associated: %pM\n", dest); printk(KERN_INFO"New client associated: %pM\n", dest);
} }
void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, short pwr) void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, short pwr)
{ {
struct sk_buff *buf = ieee80211_null_func(ieee, pwr); struct sk_buff *buf = ieee80211_null_func(ieee, pwr);
if (buf) if (buf)
softmac_ps_mgmt_xmit(buf, ieee); softmac_ps_mgmt_xmit(buf, ieee);
} }
static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h, static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h,
u32 *time_l) u32 *time_l)
{ {
@ -1537,8 +1478,6 @@ static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h,
} }
return 1; return 1;
} }
static inline void ieee80211_sta_ps(struct ieee80211_device *ieee) static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
@ -1552,7 +1491,6 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
spin_lock_irqsave(&ieee->lock, flags); spin_lock_irqsave(&ieee->lock, flags);
if((ieee->ps == IEEE80211_PS_DISABLED || if((ieee->ps == IEEE80211_PS_DISABLED ||
ieee->iw_mode != IW_MODE_INFRA || ieee->iw_mode != IW_MODE_INFRA ||
ieee->state != IEEE80211_LINKED)){ ieee->state != IEEE80211_LINKED)){
@ -1570,16 +1508,12 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
goto out; goto out;
if(sleep == 1){ if(sleep == 1){
if(ieee->sta_sleep == 1) if(ieee->sta_sleep == 1)
ieee->enter_sleep_state(ieee->dev,th,tl); ieee->enter_sleep_state(ieee->dev,th,tl);
else if(ieee->sta_sleep == 0){ else if(ieee->sta_sleep == 0){
spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
if(ieee->ps_is_queue_empty(ieee->dev)){ if(ieee->ps_is_queue_empty(ieee->dev)){
ieee->sta_sleep = 2; ieee->sta_sleep = 2;
ieee->ps_request_tx_ack(ieee->dev); ieee->ps_request_tx_ack(ieee->dev);
@ -1590,10 +1524,7 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
ieee->ps_tl = tl; ieee->ps_tl = tl;
} }
spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2);
} }
}else if(sleep == 2){ }else if(sleep == 2){
//#warning CHECK_LOCK_HERE //#warning CHECK_LOCK_HERE
spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
@ -1602,10 +1533,8 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2);
} }
out: out:
spin_unlock_irqrestore(&ieee->lock, flags); spin_unlock_irqrestore(&ieee->lock, flags);
} }
void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl) void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl)
@ -1616,7 +1545,6 @@ void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl)
ieee80211_sta_ps_send_null_frame(ieee, 0); ieee80211_sta_ps_send_null_frame(ieee, 0);
} }
return; return;
} }
if(ieee->sta_sleep == 1) if(ieee->sta_sleep == 1)
@ -1646,7 +1574,6 @@ void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success)
*/ */
} }
else { else {
if((ieee->sta_sleep == 0) && !success){ if((ieee->sta_sleep == 0) && !success){
spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
ieee80211_sta_ps_send_null_frame(ieee, 0); ieee80211_sta_ps_send_null_frame(ieee, 0);
@ -1683,10 +1610,8 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
ieee->last_rx_ps_time = jiffies; ieee->last_rx_ps_time = jiffies;
switch (WLAN_FC_GET_STYPE(header->frame_control)) { switch (WLAN_FC_GET_STYPE(header->frame_control)) {
case IEEE80211_STYPE_ASSOC_RESP: case IEEE80211_STYPE_ASSOC_RESP:
case IEEE80211_STYPE_REASSOC_RESP: case IEEE80211_STYPE_REASSOC_RESP:
IEEE80211_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n", IEEE80211_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n",
WLAN_FC_GET_STYPE(header->frame_ctl)); WLAN_FC_GET_STYPE(header->frame_ctl));
if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
@ -1765,22 +1690,17 @@ associate_complete:
} }
} }
break; break;
case IEEE80211_STYPE_ASSOC_REQ: case IEEE80211_STYPE_ASSOC_REQ:
case IEEE80211_STYPE_REASSOC_REQ: case IEEE80211_STYPE_REASSOC_REQ:
if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
ieee->iw_mode == IW_MODE_MASTER) ieee->iw_mode == IW_MODE_MASTER)
ieee80211_rx_assoc_rq(ieee, skb); ieee80211_rx_assoc_rq(ieee, skb);
break; break;
case IEEE80211_STYPE_AUTH: case IEEE80211_STYPE_AUTH:
if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE){ if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE){
if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING && if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING &&
ieee->iw_mode == IW_MODE_INFRA){ ieee->iw_mode == IW_MODE_INFRA){
IEEE80211_DEBUG_MGMT("Received authentication response"); IEEE80211_DEBUG_MGMT("Received authentication response");
errcode = auth_parse(skb, &challenge, &chlen); errcode = auth_parse(skb, &challenge, &chlen);
@ -1804,9 +1724,7 @@ associate_complete:
} }
} }
break; break;
case IEEE80211_STYPE_PROBE_REQ: case IEEE80211_STYPE_PROBE_REQ:
if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
((ieee->iw_mode == IW_MODE_ADHOC || ((ieee->iw_mode == IW_MODE_ADHOC ||
ieee->iw_mode == IW_MODE_MASTER) && ieee->iw_mode == IW_MODE_MASTER) &&
@ -1814,7 +1732,6 @@ associate_complete:
ieee80211_rx_probe_rq(ieee, skb); ieee80211_rx_probe_rq(ieee, skb);
break; break;
case IEEE80211_STYPE_DISASSOC: case IEEE80211_STYPE_DISASSOC:
case IEEE80211_STYPE_DEAUTH: case IEEE80211_STYPE_DEAUTH:
/* FIXME for now repeat all the association procedure /* FIXME for now repeat all the association procedure
@ -1829,19 +1746,14 @@ associate_complete:
queue_work(ieee->wq, &ieee->associate_procedure_wq); queue_work(ieee->wq, &ieee->associate_procedure_wq);
} }
break; break;
default: default:
return -1; return -1;
break; break;
} }
return 0; return 0;
} }
/* following are for a simpler TX queue management. /* following are for a simpler TX queue management.
* Instead of using netif_[stop/wake]_queue the driver * Instead of using netif_[stop/wake]_queue the driver
* will uses these two function (plus a reset one), that * will uses these two function (plus a reset one), that
@ -1864,8 +1776,6 @@ associate_complete:
void ieee80211_softmac_xmit(struct ieee80211_txb *txb, void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
struct ieee80211_device *ieee) struct ieee80211_device *ieee)
{ {
unsigned long flags; unsigned long flags;
int i; int i;
@ -1875,7 +1785,6 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
ieee80211_sta_wakeup(ieee,0); ieee80211_sta_wakeup(ieee,0);
for(i = 0; i < txb->nr_frags; i++) { for(i = 0; i < txb->nr_frags; i++) {
if (ieee->queue_stop){ if (ieee->queue_stop){
ieee->tx_pending.txb = txb; ieee->tx_pending.txb = txb;
ieee->tx_pending.frag = i; ieee->tx_pending.frag = i;
@ -1894,7 +1803,6 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
exit: exit:
spin_unlock_irqrestore(&ieee->lock,flags); spin_unlock_irqrestore(&ieee->lock,flags);
} }
/* called with ieee->lock acquired */ /* called with ieee->lock acquired */
@ -1907,7 +1815,6 @@ static void ieee80211_resume_tx(struct ieee80211_device *ieee)
ieee->tx_pending.frag = i; ieee->tx_pending.frag = i;
return; return;
}else{ }else{
ieee->softmac_data_hard_start_xmit( ieee->softmac_data_hard_start_xmit(
ieee->tx_pending.txb->fragments[i], ieee->tx_pending.txb->fragments[i],
ieee->dev,ieee->rate); ieee->dev,ieee->rate);
@ -1916,12 +1823,10 @@ static void ieee80211_resume_tx(struct ieee80211_device *ieee)
} }
} }
ieee80211_txb_free(ieee->tx_pending.txb); ieee80211_txb_free(ieee->tx_pending.txb);
ieee->tx_pending.txb = NULL; ieee->tx_pending.txb = NULL;
} }
void ieee80211_reset_queue(struct ieee80211_device *ieee) void ieee80211_reset_queue(struct ieee80211_device *ieee)
{ {
unsigned long flags; unsigned long flags;
@ -1934,12 +1839,10 @@ void ieee80211_reset_queue(struct ieee80211_device *ieee)
} }
ieee->queue_stop = 0; ieee->queue_stop = 0;
spin_unlock_irqrestore(&ieee->lock,flags); spin_unlock_irqrestore(&ieee->lock,flags);
} }
void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee) void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
{ {
unsigned long flags; unsigned long flags;
struct sk_buff *skb; struct sk_buff *skb;
struct ieee80211_hdr_3addr *header; struct ieee80211_hdr_3addr *header;
@ -1951,7 +1854,6 @@ void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
if(ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE){ if(ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE){
while (!ieee->queue_stop && (skb = dequeue_mgmt(ieee))){ while (!ieee->queue_stop && (skb = dequeue_mgmt(ieee))){
header = (struct ieee80211_hdr_3addr *) skb->data; header = (struct ieee80211_hdr_3addr *) skb->data;
header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4); header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@ -1972,27 +1874,21 @@ void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
ieee->softmac_stats.swtxawake++; ieee->softmac_stats.swtxawake++;
netif_wake_queue(ieee->dev); netif_wake_queue(ieee->dev);
} }
exit : exit :
spin_unlock_irqrestore(&ieee->lock,flags); spin_unlock_irqrestore(&ieee->lock,flags);
} }
void ieee80211_rtl_stop_queue(struct ieee80211_device *ieee) void ieee80211_rtl_stop_queue(struct ieee80211_device *ieee)
{ {
if (! netif_queue_stopped(ieee->dev)){ if (! netif_queue_stopped(ieee->dev)){
netif_stop_queue(ieee->dev); netif_stop_queue(ieee->dev);
ieee->softmac_stats.swtxstop++; ieee->softmac_stats.swtxstop++;
} }
ieee->queue_stop = 1; ieee->queue_stop = 1;
} }
inline void ieee80211_randomize_cell(struct ieee80211_device *ieee) inline void ieee80211_randomize_cell(struct ieee80211_device *ieee)
{ {
random_ether_addr(ieee->current_network.bssid); random_ether_addr(ieee->current_network.bssid);
} }
@ -2049,7 +1945,6 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
down(&ieee->wx_sem); down(&ieee->wx_sem);
if (ieee->current_network.ssid_len == 0){ if (ieee->current_network.ssid_len == 0){
strcpy(ieee->current_network.ssid,IEEE80211_DEFAULT_TX_ESSID); strcpy(ieee->current_network.ssid,IEEE80211_DEFAULT_TX_ESSID);
ieee->current_network.ssid_len = strlen(IEEE80211_DEFAULT_TX_ESSID); ieee->current_network.ssid_len = strlen(IEEE80211_DEFAULT_TX_ESSID);
@ -2085,7 +1980,6 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
ieee80211_randomize_cell(ieee); ieee80211_randomize_cell(ieee);
if(ieee->modulation & IEEE80211_CCK_MODULATION){ if(ieee->modulation & IEEE80211_CCK_MODULATION){
ieee->current_network.rates_len = 4; ieee->current_network.rates_len = 4;
ieee->current_network.rates[0] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB; ieee->current_network.rates[0] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB;
@ -2121,7 +2015,6 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
ieee->current_network.capability = WLAN_CAPABILITY_IBSS; ieee->current_network.capability = WLAN_CAPABILITY_IBSS;
if(ieee->short_slot) if(ieee->short_slot)
ieee->current_network.capability |= WLAN_CAPABILITY_SHORT_SLOT; ieee->current_network.capability |= WLAN_CAPABILITY_SHORT_SLOT;
} }
ieee->state = IEEE80211_LINKED; ieee->state = IEEE80211_LINKED;
@ -2140,6 +2033,7 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
up(&ieee->wx_sem); up(&ieee->wx_sem);
} }
inline void ieee80211_start_ibss(struct ieee80211_device *ieee) inline void ieee80211_start_ibss(struct ieee80211_device *ieee)
{ {
queue_delayed_work(ieee->wq, &ieee->start_ibss_wq, 100); queue_delayed_work(ieee->wq, &ieee->start_ibss_wq, 100);
@ -2262,7 +2156,6 @@ struct sk_buff *ieee80211_get_beacon_(struct ieee80211_device *ieee)
b->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_BEACON); b->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_BEACON);
return skb; return skb;
} }
struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee) struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee)
@ -2293,7 +2186,6 @@ void ieee80211_softmac_stop_protocol(struct ieee80211_device *ieee)
up(&ieee->wx_sem); up(&ieee->wx_sem);
} }
void ieee80211_stop_protocol(struct ieee80211_device *ieee) void ieee80211_stop_protocol(struct ieee80211_device *ieee)
{ {
if (!ieee->proto_started) if (!ieee->proto_started)
@ -2354,7 +2246,6 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
ieee->init_wmmparam_flag = 0;//reinitialize AC_xx_PARAM registers. ieee->init_wmmparam_flag = 0;//reinitialize AC_xx_PARAM registers.
/* if the user set the MAC of the ad-hoc cell and then /* if the user set the MAC of the ad-hoc cell and then
* switch to managed mode, shall we make sure that association * switch to managed mode, shall we make sure that association
* attempts does not fail just because the user provide the essid * attempts does not fail just because the user provide the essid
@ -2387,7 +2278,6 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
} }
} }
#define DRV_NAME "Ieee80211" #define DRV_NAME "Ieee80211"
void ieee80211_softmac_init(struct ieee80211_device *ieee) void ieee80211_softmac_init(struct ieee80211_device *ieee)
{ {
@ -2461,7 +2351,6 @@ void ieee80211_softmac_free(struct ieee80211_device *ieee)
del_timer_sync(&ieee->associate_timer); del_timer_sync(&ieee->associate_timer);
cancel_delayed_work(&ieee->associate_retry_wq); cancel_delayed_work(&ieee->associate_retry_wq);
//add for RF power on power of //add for RF power on power of
cancel_delayed_work(&ieee->GPIOChangeRFWorkItem); cancel_delayed_work(&ieee->GPIOChangeRFWorkItem);
@ -2474,8 +2363,6 @@ void ieee80211_softmac_free(struct ieee80211_device *ieee)
* Start of WPA code. * * Start of WPA code. *
* this is stolen from the ipw2200 driver * * this is stolen from the ipw2200 driver *
********************************************************/ ********************************************************/
static int ieee80211_wpa_enable(struct ieee80211_device *ieee, int value) static int ieee80211_wpa_enable(struct ieee80211_device *ieee, int value)
{ {
/* This is called when wpa_supplicant loads and closes the driver /* This is called when wpa_supplicant loads and closes the driver
@ -2485,7 +2372,6 @@ static int ieee80211_wpa_enable(struct ieee80211_device *ieee, int value)
return 0; return 0;
} }
static void ieee80211_wpa_assoc_frame(struct ieee80211_device *ieee, char *wpa_ie, static void ieee80211_wpa_assoc_frame(struct ieee80211_device *ieee, char *wpa_ie,
int wpa_ie_len) int wpa_ie_len)
{ {
@ -2495,11 +2381,9 @@ static void ieee80211_wpa_assoc_frame(struct ieee80211_device *ieee, char *wpa_i
ieee80211_disassociate(ieee); ieee80211_disassociate(ieee);
} }
static int ieee80211_wpa_mlme(struct ieee80211_device *ieee, int command, static int ieee80211_wpa_mlme(struct ieee80211_device *ieee, int command,
int reason) int reason)
{ {
int ret = 0; int ret = 0;
switch (command) { switch (command) {
@ -2519,7 +2403,6 @@ static int ieee80211_wpa_mlme(struct ieee80211_device *ieee, int command,
return ret; return ret;
} }
static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee, static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
struct ieee_param *param, int plen) struct ieee_param *param, int plen)
{ {
@ -2553,7 +2436,6 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value) static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value)
{ {
struct ieee80211_security sec = { struct ieee80211_security sec = {
.flags = SEC_AUTH_MODE, .flags = SEC_AUTH_MODE,
}; };
@ -2626,11 +2508,9 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
case IEEE_PARAM_PRIVACY_INVOKED: case IEEE_PARAM_PRIVACY_INVOKED:
ieee->privacy_invoked=value; ieee->privacy_invoked=value;
break; break;
case IEEE_PARAM_AUTH_ALGS: case IEEE_PARAM_AUTH_ALGS:
ret = ieee80211_wpa_set_auth_algs(ieee, value); ret = ieee80211_wpa_set_auth_algs(ieee, value);
break; break;
case IEEE_PARAM_IEEE_802_1X: case IEEE_PARAM_IEEE_802_1X:
ieee->ieee802_1x=value; ieee->ieee802_1x=value;
break; break;
@ -2640,7 +2520,6 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
ieee->wpax_type_notify = value; ieee->wpax_type_notify = value;
spin_unlock_irqrestore(&ieee->wpax_suitlist_lock,flags); spin_unlock_irqrestore(&ieee->wpax_suitlist_lock,flags);
break; break;
default: default:
printk("Unknown WPA param: %d\n",name); printk("Unknown WPA param: %d\n",name);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
@ -2817,25 +2696,20 @@ int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee,
} }
switch (param->cmd) { switch (param->cmd) {
case IEEE_CMD_SET_WPA_PARAM: case IEEE_CMD_SET_WPA_PARAM:
ret = ieee80211_wpa_set_param(ieee, param->u.wpa_param.name, ret = ieee80211_wpa_set_param(ieee, param->u.wpa_param.name,
param->u.wpa_param.value); param->u.wpa_param.value);
break; break;
case IEEE_CMD_SET_WPA_IE: case IEEE_CMD_SET_WPA_IE:
ret = ieee80211_wpa_set_wpa_ie(ieee, param, p->length); ret = ieee80211_wpa_set_wpa_ie(ieee, param, p->length);
break; break;
case IEEE_CMD_SET_ENCRYPTION: case IEEE_CMD_SET_ENCRYPTION:
ret = ieee80211_wpa_set_encryption(ieee, param, p->length); ret = ieee80211_wpa_set_encryption(ieee, param, p->length);
break; break;
case IEEE_CMD_MLME: case IEEE_CMD_MLME:
ret = ieee80211_wpa_mlme(ieee, param->u.mlme.command, ret = ieee80211_wpa_mlme(ieee, param->u.mlme.command,
param->u.mlme.reason_code); param->u.mlme.reason_code);
break; break;
default: default:
printk("Unknown WPA supplicant request: %d\n",param->cmd); printk("Unknown WPA supplicant request: %d\n",param->cmd);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;