staging: rtl8192e: Fix typo in rtl8192e
[deliverable/linux.git] / drivers / staging / rtl8192e / rtllib_rx.c
index 1a011b9b9da61840789103ef5c9dd4631806a202..7413816dd92ba00dd65238ba099f36647d577e30 100644 (file)
@@ -211,7 +211,7 @@ rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb,
         * this is not mandatory.... but seems that the probe
         * response parser uses it
         */
-       struct rtllib_hdr_3addr * hdr = (struct rtllib_hdr_3addr *)skb->data;
+       struct rtllib_hdr_3addr *hdr = (struct rtllib_hdr_3addr *)skb->data;
 
        rx_stats->len = skb->len;
        rtllib_rx_mgt(ieee, skb, rx_stats);
@@ -490,7 +490,7 @@ void rtllib_indicate_packets(struct rtllib_device *ieee, struct rtllib_rxb **prx
                        } else {
                                u16 len;
                        /* Leave Ethernet header part of hdr and full payload */
-                               len = htons(sub_skb->len);
+                               len = sub_skb->len;
                                memcpy(skb_push(sub_skb, 2), &len, 2);
                                memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
                                memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
@@ -712,7 +712,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
 
                if (index > REORDER_WIN_SIZE) {
                        RTLLIB_DEBUG(RTLLIB_DL_ERR, "RxReorderIndicatePacket():"
-                                    " Rx Reorer struct buffer full!!\n");
+                                    " Rx Reorder struct buffer full!!\n");
                        spin_unlock_irqrestore(&(ieee->reorder_spinlock),
                                               flags);
                        return;
@@ -1224,7 +1224,7 @@ static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
                        } else {
                                u16 len;
                                /* Leave Ethernet header part of hdr and full payload */
-                               len = htons(sub_skb->len);
+                               len = sub_skb->len;
                                memcpy(skb_push(sub_skb, 2), &len, 2);
                                memcpy(skb_push(sub_skb, ETH_ALEN), src, ETH_ALEN);
                                memcpy(skb_push(sub_skb, ETH_ALEN), dst, ETH_ALEN);
@@ -1632,13 +1632,13 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info
                /* WMM spec P.11: The minimum value for AIFSN shall be 2 */
                qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2 : qos_param->aifs[aci];
 
-               qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F;
+               qos_param->cw_min[aci] = cpu_to_le16(ac_params->ecw_min_max & 0x0F);
 
-               qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 4;
+               qos_param->cw_max[aci] = cpu_to_le16((ac_params->ecw_min_max & 0xF0) >> 4);
 
                qos_param->flag[aci] =
                    (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
-               qos_param->tx_op_limit[aci] = le16_to_cpu(ac_params->tx_op_limit);
+               qos_param->tx_op_limit[aci] = ac_params->tx_op_limit;
        }
        return rc;
 }
@@ -2260,9 +2260,9 @@ static inline int rtllib_network_init(
        memcpy(network->bssid, beacon->header.addr3, ETH_ALEN);
        network->capability = le16_to_cpu(beacon->capability);
        network->last_scanned = jiffies;
-       network->time_stamp[0] = le32_to_cpu(beacon->time_stamp[0]);
-       network->time_stamp[1] = le32_to_cpu(beacon->time_stamp[1]);
-       network->beacon_interval = le32_to_cpu(beacon->beacon_interval);
+       network->time_stamp[0] = beacon->time_stamp[0];
+       network->time_stamp[1] = beacon->time_stamp[1];
+       network->beacon_interval = le16_to_cpu(beacon->beacon_interval);
        /* Where to pull this? beacon->listen_interval;*/
        network->listen_interval = 0x0A;
        network->rates_len = network->rates_ex_len = 0;
@@ -2528,29 +2528,30 @@ static inline void rtllib_process_probe_response(
                "'%s' ( %pM ): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
                escape_essid(info_element->data, info_element->len),
                beacon->header.addr3,
-               (beacon->capability & (1<<0xf)) ? '1' : '0',
-               (beacon->capability & (1<<0xe)) ? '1' : '0',
-               (beacon->capability & (1<<0xd)) ? '1' : '0',
-               (beacon->capability & (1<<0xc)) ? '1' : '0',
-               (beacon->capability & (1<<0xb)) ? '1' : '0',
-               (beacon->capability & (1<<0xa)) ? '1' : '0',
-               (beacon->capability & (1<<0x9)) ? '1' : '0',
-               (beacon->capability & (1<<0x8)) ? '1' : '0',
-               (beacon->capability & (1<<0x7)) ? '1' : '0',
-               (beacon->capability & (1<<0x6)) ? '1' : '0',
-               (beacon->capability & (1<<0x5)) ? '1' : '0',
-               (beacon->capability & (1<<0x4)) ? '1' : '0',
-               (beacon->capability & (1<<0x3)) ? '1' : '0',
-               (beacon->capability & (1<<0x2)) ? '1' : '0',
-               (beacon->capability & (1<<0x1)) ? '1' : '0',
-               (beacon->capability & (1<<0x0)) ? '1' : '0');
+               (le16_to_cpu(beacon->capability) & (1<<0xf)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0xe)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0xd)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0xc)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0xb)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0xa)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x9)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x8)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x7)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x6)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x5)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x4)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x3)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x2)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x1)) ? '1' : '0',
+               (le16_to_cpu(beacon->capability) & (1<<0x0)) ? '1' : '0');
 
        if (rtllib_network_init(ieee, beacon, network, stats)) {
                RTLLIB_DEBUG_SCAN("Dropped '%s' ( %pM) via %s.\n",
                                  escape_essid(info_element->data,
                                  info_element->len),
                                  beacon->header.addr3,
-                                 WLAN_FC_GET_STYPE(beacon->header.frame_ctl) ==
+                                 WLAN_FC_GET_STYPE(
+                                         le16_to_cpu(beacon->header.frame_ctl)) ==
                                  RTLLIB_STYPE_PROBE_RESP ?
                                  "PROBE RESPONSE" : "BEACON");
                goto free_network;
@@ -2560,7 +2561,7 @@ static inline void rtllib_process_probe_response(
        if (!rtllib_legal_channel(ieee, network->channel))
                goto free_network;
 
-       if (WLAN_FC_GET_STYPE(beacon->header.frame_ctl) ==
+       if (WLAN_FC_GET_STYPE(le16_to_cpu(beacon->header.frame_ctl)) ==
            RTLLIB_STYPE_PROBE_RESP) {
                if (IsPassiveChannel(ieee, network->channel)) {
                        printk(KERN_INFO "GetScanInfo(): For Global Domain, "
@@ -2629,7 +2630,8 @@ static inline void rtllib_process_probe_response(
                RTLLIB_DEBUG_SCAN("Adding '%s' ( %pM) via %s.\n",
                                  escape_essid(network->ssid,
                                  network->ssid_len), network->bssid,
-                                 WLAN_FC_GET_STYPE(beacon->header.frame_ctl) ==
+                                 WLAN_FC_GET_STYPE(
+                                         le16_to_cpu(beacon->header.frame_ctl)) ==
                                  RTLLIB_STYPE_PROBE_RESP ?
                                  "PROBE RESPONSE" : "BEACON");
                memcpy(target, network, sizeof(*target));
@@ -2640,7 +2642,8 @@ static inline void rtllib_process_probe_response(
                RTLLIB_DEBUG_SCAN("Updating '%s' ( %pM) via %s.\n",
                                  escape_essid(target->ssid,
                                  target->ssid_len), target->bssid,
-                                 WLAN_FC_GET_STYPE(beacon->header.frame_ctl) ==
+                                 WLAN_FC_GET_STYPE(
+                                         le16_to_cpu(beacon->header.frame_ctl)) ==
                                  RTLLIB_STYPE_PROBE_RESP ?
                                  "PROBE RESPONSE" : "BEACON");
 
@@ -2682,15 +2685,17 @@ void rtllib_rx_mgt(struct rtllib_device *ieee,
 {
        struct rtllib_hdr_4addr *header = (struct rtllib_hdr_4addr *)skb->data ;
 
-       if (WLAN_FC_GET_STYPE(header->frame_ctl) != RTLLIB_STYPE_PROBE_RESP &&
-           WLAN_FC_GET_STYPE(header->frame_ctl) != RTLLIB_STYPE_BEACON)
+       if ((WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) !=
+           RTLLIB_STYPE_PROBE_RESP) &&
+           (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) !=
+           RTLLIB_STYPE_BEACON))
                ieee->last_rx_ps_time = jiffies;
 
-       switch (WLAN_FC_GET_STYPE(header->frame_ctl)) {
+       switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
 
        case RTLLIB_STYPE_BEACON:
                RTLLIB_DEBUG_MGMT("received BEACON (%d)\n",
-                                 WLAN_FC_GET_STYPE(header->frame_ctl));
+                                 WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
                RTLLIB_DEBUG_SCAN("Beacon\n");
                rtllib_process_probe_response(
                                ieee, (struct rtllib_probe_response *)header,
@@ -2705,14 +2710,15 @@ void rtllib_rx_mgt(struct rtllib_device *ieee,
 
        case RTLLIB_STYPE_PROBE_RESP:
                RTLLIB_DEBUG_MGMT("received PROBE RESPONSE (%d)\n",
-                       WLAN_FC_GET_STYPE(header->frame_ctl));
+                       WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
                RTLLIB_DEBUG_SCAN("Probe response\n");
                rtllib_process_probe_response(ieee,
                              (struct rtllib_probe_response *)header, stats);
                break;
        case RTLLIB_STYPE_PROBE_REQ:
                RTLLIB_DEBUG_MGMT("received PROBE RESQUEST (%d)\n",
-                                 WLAN_FC_GET_STYPE(header->frame_ctl));
+                                 WLAN_FC_GET_STYPE(
+                                         le16_to_cpu(header->frame_ctl)));
                RTLLIB_DEBUG_SCAN("Probe request\n");
                if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
                    ((ieee->iw_mode == IW_MODE_ADHOC ||
This page took 0.050078 seconds and 5 git commands to generate.