#include <linux/etherdevice.h>
#include <linux/if_ether.h>
#include <linux/if_arp.h>
-
-/* Include Wireless Extension definition and check version */
-#include <net/iw_handler.h> /* New driver API */
+#include <net/iw_handler.h>
static inline void inc_smeqhead(struct ks_wlan_private *priv)
{
return -EPERM;
}
- /* bssid */
memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
- /* essid */
memcpy(ap->ssid.body, priv->reg.ssid.body,
priv->reg.ssid.size);
ap->ssid.size = priv->reg.ssid.size;
- /* rate_set */
memcpy(ap->rate_set.body, ap_info->rate_set.body,
ap_info->rate_set.size);
ap->rate_set.size = ap_info->rate_set.size;
if (ap_info->ext_rate_set.size != 0) {
- /* rate_set */
memcpy(&ap->rate_set.body[ap->rate_set.size],
ap_info->ext_rate_set.body,
ap_info->ext_rate_set.size);
ap->rate_set.size += ap_info->ext_rate_set.size;
}
- /* channel */
ap->channel = ap_info->ds_parameter.channel;
- /* rssi */
ap->rssi = ap_info->rssi;
- /* sq */
ap->sq = ap_info->sq;
- /* noise */
ap->noise = ap_info->noise;
- /* capability */
ap->capability = le16_to_cpu(ap_info->capability);
- /* rsn */
if ((ap_info->rsn_mode & RSN_MODE_WPA2) &&
(priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2)) {
ap->rsn_ie.id = 0x30;
memset(ap, 0, sizeof(struct local_ap));
- /* bssid */
memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
- /* rssi */
ap->rssi = ap_info->rssi;
- /* sq */
ap->sq = ap_info->sq;
- /* noise */
ap->noise = ap_info->noise;
- /* capability */
ap->capability = le16_to_cpu(ap_info->capability);
- /* channel */
ap->channel = ap_info->ch_info;
bp = ap_info->body;
mib_val_type = get_word(priv); /* MIB value type */
if (mib_status) {
- /* in case of error */
netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
mib_attribute, mib_status);
return;
switch (mib_attribute) {
case DOT11_MAC_ADDRESS:
- /* MAC address */
hostif_sme_enqueue(priv, SME_GET_MAC_ADDRESS);
memcpy(priv->eth_addr, priv->rxp, ETH_ALEN);
priv->mac_address_valid = true;
netdev_info(dev, "MAC ADDRESS = %pM\n", priv->eth_addr);
break;
case DOT11_PRODUCT_VERSION:
- /* firmware version */
priv->version_size = priv->rx_size;
memcpy(priv->firmware_version, priv->rxp, priv->rx_size);
priv->firmware_version[priv->rx_size] = '\0';
connect_code = get_word(priv);
switch (connect_code) {
- case RESULT_CONNECT: /* connect */
+ case RESULT_CONNECT:
if (!(priv->connect_status & FORCE_DISCONNECT))
netif_carrier_on(netdev);
tmp = FORCE_DISCONNECT & priv->connect_status;
priv->connect_status = tmp + CONNECT_STATUS;
break;
- case RESULT_DISCONNECT: /* disconnect */
+ case RESULT_DISCONNECT:
netif_carrier_off(netdev);
tmp = FORCE_DISCONNECT & priv->connect_status;
priv->connect_status = tmp + DISCONNECT_STATUS;
{
unsigned short event;
- event = get_word(priv); /* get event */
+ event = get_word(priv);
switch (event) {
case HIF_DATA_IND:
hostif_data_indication(priv);
if (!priv->is_device_open)
return;
- spin_lock(&priv->dev_read_lock); /* request spin lock */
+ spin_lock(&priv->dev_read_lock);
priv->dev_data[atomic_read(&priv->rec_count)] = p;
priv->dev_size[atomic_read(&priv->rec_count)] = size;
wake_up_interruptible_all(&priv->devread_wait);
- /* release spin lock */
spin_unlock(&priv->dev_read_lock);
}
priv->rxp = p;
priv->rx_size = size;
- if (get_word(priv) == priv->rx_size) { /* length check !! */
- hostif_event_check(priv); /* event check */
+ if (get_word(priv) == priv->rx_size) {
+ hostif_event_check(priv);
}
}
switch (priv->reg.operation_mode) {
case MODE_PSEUDO_ADHOC:
- /* Pseudo Ad-Hoc mode */
hostif_ps_adhoc_set_request(priv);
break;
case MODE_INFRASTRUCTURE:
- /* Infrastructure mode */
if (!is_valid_ether_addr((u8 *)priv->reg.bssid)) {
hostif_infrastructure_set_request(priv, HIF_INFRA_SET_REQ);
} else {
}
break;
case MODE_ADHOC:
- /* IEEE802.11 Ad-Hoc mode */
if (!is_valid_ether_addr((u8 *)priv->reg.bssid)) {
hostif_adhoc_set_request(priv);
} else {