~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/wireless/wl12xx/rx.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "rx.h"
30
30
#include "io.h"
31
31
 
32
 
static u8 wl1271_rx_get_mem_block(struct wl1271_fw_status *status,
 
32
static u8 wl1271_rx_get_mem_block(struct wl1271_fw_common_status *status,
33
33
                                  u32 drv_rx_counter)
34
34
{
35
35
        return le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) &
36
36
                RX_MEM_BLOCK_MASK;
37
37
}
38
38
 
39
 
static u32 wl1271_rx_get_buf_size(struct wl1271_fw_status *status,
 
39
static u32 wl1271_rx_get_buf_size(struct wl1271_fw_common_status *status,
40
40
                                 u32 drv_rx_counter)
41
41
{
42
42
        return (le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) &
76
76
         */
77
77
        wl->noise = desc->rssi - (desc->snr >> 1);
78
78
 
79
 
        status->freq = ieee80211_channel_to_frequency(desc->channel);
 
79
        status->freq = ieee80211_channel_to_frequency(desc->channel, desc_band);
80
80
 
81
81
        if (desc->flags & WL1271_RX_DESC_ENCRYPT_MASK) {
82
82
                status->flag |= RX_FLAG_IV_STRIPPED | RX_FLAG_MMIC_STRIPPED;
92
92
{
93
93
        struct wl1271_rx_descriptor *desc;
94
94
        struct sk_buff *skb;
95
 
        u16 *fc;
 
95
        struct ieee80211_hdr *hdr;
96
96
        u8 *buf;
97
97
        u8 beacon = 0;
98
98
 
118
118
        /* now we pull the descriptor out of the buffer */
119
119
        skb_pull(skb, sizeof(*desc));
120
120
 
121
 
        fc = (u16 *)skb->data;
122
 
        if ((*fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON)
 
121
        hdr = (struct ieee80211_hdr *)skb->data;
 
122
        if (ieee80211_is_beacon(hdr->frame_control))
123
123
                beacon = 1;
124
124
 
125
125
        wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon);
129
129
 
130
130
        skb_trim(skb, skb->len - desc->pad_len);
131
131
 
132
 
        ieee80211_rx_ni(wl->hw, skb);
 
132
        skb_queue_tail(&wl->deferred_rx_queue, skb);
 
133
        ieee80211_queue_work(wl->hw, &wl->netstack_work);
133
134
 
134
135
        return 0;
135
136
}
136
137
 
137
 
void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status)
 
138
void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_common_status *status)
138
139
{
139
140
        struct wl1271_acx_mem_map *wl_mem_map = wl->target_mem_map;
140
141
        u32 buf_size;
198
199
                        pkt_offset += pkt_length;
199
200
                }
200
201
        }
201
 
        wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS,
202
 
                        cpu_to_le32(wl->rx_counter));
 
202
 
 
203
        /*
 
204
         * Write the driver's packet counter to the FW. This is only required
 
205
         * for older hardware revisions
 
206
         */
 
207
        if (wl->quirks & WL12XX_QUIRK_END_OF_TRANSACTION)
 
208
                wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS, wl->rx_counter);
 
209
}
 
210
 
 
211
void wl1271_set_default_filters(struct wl1271 *wl)
 
212
{
 
213
        if (wl->bss_type == BSS_TYPE_AP_BSS) {
 
214
                wl->rx_config = WL1271_DEFAULT_AP_RX_CONFIG;
 
215
                wl->rx_filter = WL1271_DEFAULT_AP_RX_FILTER;
 
216
        } else {
 
217
                wl->rx_config = WL1271_DEFAULT_STA_RX_CONFIG;
 
218
                wl->rx_filter = WL1271_DEFAULT_STA_RX_FILTER;
 
219
        }
203
220
}