}
/* place the MFIE rate, tag to the memory (double) poised.
- * Then it updates the pointer so that
- * it points after the new MFIE tag added.
+ * Then it updates the pointer so that it points after the new MFIE tag added.
*/
static void ieee80211_MFIE_Brate(struct ieee80211_device *ieee, u8 **tag_p)
{
{
u8 *tag = *tag_p;
- *tag++ = MFIE_TYPE_GENERIC; //0
+ *tag++ = MFIE_TYPE_GENERIC; /* 0 */
*tag++ = 7;
*tag++ = 0x00;
*tag++ = 0x50;
*tag++ = 0xf2;
- *tag++ = 0x02;//5
+ *tag++ = 0x02; /* 5 */
*tag++ = 0x00;
*tag++ = 0x01;
#ifdef SUPPORT_USPD
req = (struct ieee80211_probe_request *) skb_put(skb,sizeof(struct ieee80211_probe_request));
req->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
- req->header.duration_id = 0; //FIXME: is this OK ?
+ req->header.duration_id = 0; /* FIXME: is this OK ? */
memset(req->header.addr1, 0xff, ETH_ALEN);
memcpy(req->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
while(1)
{
- /* this function can be called in two situations
- * 1- We have switched to ad-hoc mode and we are
- * performing a complete syncro scan before conclude
- * there are no interesting cell and to create a
- * new one. In this case the link state is
- * IEEE80211_NOLINK until we found an interesting cell.
- * If so the ieee8021_new_net, called by the RX path
- * will set the state to IEEE80211_LINKED, so we stop
- * scanning
- * 2- We are linked and the root uses run iwlist scan.
- * So we switch to IEEE80211_LINKED_SCANNING to remember
- * that we are still logically linked (not interested in
- * new network events, despite for updating the net list,
- * but we are temporarily 'unlinked' as the driver shall
- * not filter RX frames and the channel is changing.
- * So the only situation in witch are interested is to check
- * if the state become LINKED because of the #1 situation
- */
+ /* this function can be called in two situations
+ * 1- We have switched to ad-hoc mode and we are
+ * performing a complete syncro scan before conclude
+ * there are no interesting cell and to create a
+ * new one. In this case the link state is
+ * IEEE80211_NOLINK until we found an interesting cell.
+ * If so the ieee8021_new_net, called by the RX path
+ * will set the state to IEEE80211_LINKED, so we stop
+ * scanning
+ * 2- We are linked and the root uses run iwlist scan.
+ * So we switch to IEEE80211_LINKED_SCANNING to remember
+ * that we are still logically linked (not interested in
+ * new network events, despite for updating the net list,
+ * but we are temporarily 'unlinked' as the driver shall
+ * not filter RX frames and the channel is changing.
+ * So the only situation in witch are interested is to check
+ * if the state become LINKED because of the #1 situation
+ */
if (ieee->state == IEEE80211_LINKED)
{
goto out;
auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
- auth->header.duration_id = 0x013a; //FIXME
+ auth->header.duration_id = 0x013a; /* FIXME */
memcpy(auth->header.addr1, beacon->bssid, ETH_ALEN);
memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
beacon_size = sizeof(struct ieee80211_probe_response)+
ssid_len
- +3 //channel
+ +3 /* channel */
+rate_len
+rate_ex_len
+atim_len
memcpy (beacon_buf->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
memcpy (beacon_buf->header.addr3, ieee->current_network.bssid, ETH_ALEN);
- beacon_buf->header.duration_id = 0; //FIXME
+ beacon_buf->header.duration_id = 0; /* FIXME */
beacon_buf->beacon_interval =
cpu_to_le16(ieee->current_network.beacon_interval);
beacon_buf->capability =
if (wpa_ie_len)
{
if (ieee->iw_mode == IW_MODE_ADHOC)
- {//as Windows will set pairwise key same as the group key which is not allowed in Linux, so set this for IOT issue.
+ {
+ /* as Windows will set pairwise key same as the group
+ * key which is not allowed in Linux, so set this for
+ * IOT issue.
+ */
memcpy(&ieee->wpa_ie[14], &ieee->wpa_ie[8], 4);
}
u8 *tag;
unsigned int wpa_len = beacon->wpa_ie_len;
#if 1
- // for testing purpose
+ /* for testing purpose */
unsigned int rsn_len = beacon->rsn_ie_len;
#endif
unsigned int rate_len = ieee80211_MFIE_rate_len(ieee);
int len = 0;
- //[0] Notify type of encryption: WPA/WPA2
- //[1] pair wise type
- //[2] authen type
+ /* [0] Notify type of encryption: WPA/WPA2
+ * [1] pair wise type
+ * [2] authen type
+ */
if(ieee->wpax_type_set) {
if (IEEE_PROTO_WPA == encry_proto) {
rsn_len = 0;
}
}
len = sizeof(struct ieee80211_assoc_request_frame)+
- + beacon->ssid_len//essid tagged val
- + rate_len//rates tagged val
+ + beacon->ssid_len /* essid tagged val */
+ + rate_len /* rates tagged val */
+ wpa_len
+ rsn_len
+ wmm_info_len
skb_put(skb, sizeof(struct ieee80211_assoc_request_frame));
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.addr2, ieee->dev->dev_addr, ETH_ALEN);
memcpy(hdr->header.addr3, beacon->bssid, ETH_ALEN);
- memcpy(ieee->ap_mac_addr, beacon->bssid, ETH_ALEN);//for HW security
+ memcpy(ieee->ap_mac_addr, beacon->bssid, ETH_ALEN); /* for HW security */
hdr->capability = cpu_to_le16(WLAN_CAPABILITY_BSS);
if (beacon->capability & WLAN_CAPABILITY_PRIVACY )
if(ieee->short_slot)
hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
- hdr->listen_interval = 0xa; //FIXME
+ hdr->listen_interval = 0xa; /* FIXME */
hdr->info_element.id = MFIE_TYPE_SSID;
ieee80211_MFIE_Brate(ieee, &tag);
ieee80211_MFIE_Grate(ieee, &tag);
- //add rsn==0 condition for ap's mix security mode(wpa+wpa2)
- //choose AES encryption as default algorithm while using mixed mode
+ /* add rsn==0 condition for ap's mix security mode(wpa+wpa2)
+ * choose AES encryption as default algorithm while using mixed mode.
+ */
tag = skb_put(skb,ieee->wpa_ie_len);
memcpy(tag,ieee->wpa_ie,ieee->wpa_ie_len);
ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING ;
IEEE80211_DEBUG_MGMT("Sending authentication request\n");
softmac_mgmt_xmit(skb, ieee);
- //BUGON when you try to add_timer twice, using mod_timer may be better
+ /* BUGON when you try to add_timer twice, using mod_timer may
+ * be better.
+ */
if(!timer_pending(&ieee->associate_timer)){
ieee->associate_timer.expires = jiffies + (HZ / 2);
add_timer(&ieee->associate_timer);
}
- //If call dev_kfree_skb_any,a warning will ocur....
- //KERNEL: assertion (!atomic_read(&skb->users)) failed at net/core/dev.c (1708)
+ /* If call dev_kfree_skb_any,a warning will ocur....
+ * KERNEL: assertion (!atomic_read(&skb->users)) failed at
+ * net/core/dev.c (1708)
+ */
}
}
ieee->iw_mode != IW_MODE_INFRA ||
ieee->state != IEEE80211_LINKED)){
- //#warning CHECK_LOCK_HERE
+ /* #warning CHECK_LOCK_HERE */
spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
ieee80211_sta_wakeup(ieee, 1);
spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2);
}
}else if(sleep == 2){
-//#warning CHECK_LOCK_HERE
+ /* #warning CHECK_LOCK_HERE */
spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
ieee80211_sta_wakeup(ieee,1);
ieee->state=IEEE80211_LINKED;
ieee->assoc_id = aid;
ieee->softmac_stats.rx_ass_ok++;
-
- if(1 == rx_stats->nic_type) //card type is 8187
+ /* card type is 8187 */
+ if(1 == rx_stats->nic_type)
{
goto associate_complete;
}
info_element->data[2] == 0xf2 &&
info_element->data[3] == 0x02 &&
info_element->data[4] == 0x01) {
- // Not care about version at present.
- //WMM Parameter Element
+ /* Not care about version at present.
+ * WMM Parameter Element.
+ */
memcpy(ieee->current_network.wmm_param,(u8*)(info_element->data\
+ 8),(info_element->len - 8));
if (((ieee->current_network.wmm_info^info_element->data[6])& \
0x0f)||(!ieee->init_wmmparam_flag)) {
- // refresh parameter element for current network
- // update the register parameter for hardware
+ /* refresh parameter element for current network
+ * update the register parameter for hardware.
+ */
ieee->init_wmmparam_flag = 1;
queue_work(ieee->wq, &ieee->wmm_param_update_wq);
}
- //update info_element for current network
+ /* update info_element for current network */
ieee->current_network.wmm_info = info_element->data[6];
}
break;
default:
- //nothing to do at present!!!
+ /* nothing to do at present!!! */
break;
}
info_element = (struct ieee80211_info_element *)
&info_element->data[info_element->len];
}
- if(!ieee->init_wmmparam_flag) //legacy AP, reset the AC_xx_param register
+ if(!ieee->init_wmmparam_flag) /* legacy AP, reset the AC_xx_param register */
{
queue_work(ieee->wq,&ieee->wmm_param_update_wq);
- ieee->init_wmmparam_flag = 1;//indicate AC_xx_param upated since last associate
+ ieee->init_wmmparam_flag = 1; /* indicate AC_xx_param upated since last associate */
}
associate_complete:
ieee80211_associate_complete(ieee);
case IEEE80211_STYPE_DISASSOC:
case IEEE80211_STYPE_DEAUTH:
/* FIXME for now repeat all the association procedure
- * both for disassociation and deauthentication
- */
+ * both for disassociation and deauthentication
+ */
if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
(ieee->state == IEEE80211_LINKED) &&
(ieee->iw_mode == IW_MODE_INFRA) &&
ieee->rate = 110;
}
- // By default, WMM function will be disabled in IBSS mode
+ /* By default, WMM function will be disabled in IBSS mode */
ieee->current_network.QoS_Enable = 0;
ieee->current_network.atim_window = 0;
void ieee80211_start_bss(struct ieee80211_device *ieee)
{
unsigned long flags;
- //
- // Ref: 802.11d 11.1.3.3
- // STA shall not start a BSS unless properly formed Beacon frame including a Country IE.
- //
+ /* Ref: 802.11d 11.1.3.3
+ * STA shall not start a BSS unless properly formed Beacon frame
+ * including a Country IE.
+ */
if(IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
{
if(! ieee->bGlobalDomain)
return;
}
}
- /* check if we have already found the net we
- * are interested in (if any).
+ /* check if we have already found the net we are interested in (if any).
* if not (we are disassociated and we are not
* in associating / authenticating phase) start the background scanning.
*/
ieee->last_packet_time[i] = 0;
}
- 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
* switch to managed mode, shall we make sure that association
switch (ieee->iw_mode) {
case IW_MODE_AUTO:
ieee->iw_mode = IW_MODE_INFRA;
- //not set break here intentionly
+ /* not set break here intentionly */
case IW_MODE_INFRA:
ieee80211_start_bss(ieee);
break;
ieee->assoc_id = 0;
ieee->queue_stop = 0;
ieee->scanning = 0;
- ieee->softmac_features = 0; //so IEEE2100-like driver are happy
+ ieee->softmac_features = 0; /* so IEEE2100-like driver are happy */
ieee->wap_set = 0;
ieee->ssid_set = 0;
ieee->proto_started = 0;
del_timer_sync(&ieee->associate_timer);
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);
destroy_workqueue(ieee->wq);
up(&ieee->wx_sem);
}
-/********************************************************
- * Start of WPA code. *
- * this is stolen from the ipw2200 driver *
- ********************************************************/
+/* Start of WPA code. This is stolen from the ipw2200 driver */
static int ieee80211_wpa_enable(struct ieee80211_device *ieee, int value)
{
/* This is called when wpa_supplicant loads and closes the driver
switch (command) {
case IEEE_MLME_STA_DEAUTH:
- // silently ignore
+ /* silently ignore */
break;
case IEEE_MLME_STA_DISASSOC:
if (strcmp(param->u.crypt.alg, "none") == 0) {
if (crypt) {
sec.enabled = 0;
- // FIXME FIXME
+ /* FIXME FIXME */
sec.level = SEC_LEVEL_0;
sec.flags |= SEC_ENABLED | SEC_LEVEL;
ieee80211_crypt_delayed_deinit(ieee, crypt);
goto done;
}
sec.enabled = 1;
-// FIXME FIXME
+ /* FIXME FIXME */
sec.flags |= SEC_ENABLED;
/* IPW HW cannot build TKIP MIC, host decryption still needed. */