diff options
author | Kalle Valo <kalle.valo@nokia.com> | 2009-06-12 07:17:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 14:57:50 -0400 |
commit | 80301cdcfe44e3533175be23d7d52a9fc8c3fdb0 (patch) | |
tree | 624d018b822016a8f83d49588012519a4e9a4d16 /drivers/net/wireless/wl12xx/wl1251_rx.c | |
parent | 1e6f172fccbf1194bad4b2aeae437ec3189a3f08 (diff) |
wl1251: use wl1251 prefix everywhere
Last we can change all code prefixes from wl12xx/WL12XX to
wl1251/WL1251.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_rx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_rx.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_rx.c b/drivers/net/wireless/wl12xx/wl1251_rx.c index 280fc1843f8..48fa39ea17e 100644 --- a/drivers/net/wireless/wl12xx/wl1251_rx.c +++ b/drivers/net/wireless/wl12xx/wl1251_rx.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * This file is part of wl12xx | 2 | * This file is part of wl1251 |
3 | * | 3 | * |
4 | * Copyright (c) 1998-2007 Texas Instruments Incorporated | 4 | * Copyright (c) 1998-2007 Texas Instruments Incorporated |
5 | * Copyright (C) 2008 Nokia Corporation | 5 | * Copyright (C) 2008 Nokia Corporation |
@@ -31,8 +31,8 @@ | |||
31 | #include "wl1251_rx.h" | 31 | #include "wl1251_rx.h" |
32 | #include "wl1251_acx.h" | 32 | #include "wl1251_acx.h" |
33 | 33 | ||
34 | static void wl12xx_rx_header(struct wl12xx *wl, | 34 | static void wl1251_rx_header(struct wl1251 *wl, |
35 | struct wl12xx_rx_descriptor *desc) | 35 | struct wl1251_rx_descriptor *desc) |
36 | { | 36 | { |
37 | u32 rx_packet_ring_addr; | 37 | u32 rx_packet_ring_addr; |
38 | 38 | ||
@@ -40,11 +40,11 @@ static void wl12xx_rx_header(struct wl12xx *wl, | |||
40 | if (wl->rx_current_buffer) | 40 | if (wl->rx_current_buffer) |
41 | rx_packet_ring_addr += wl->data_path->rx_packet_ring_chunk_size; | 41 | rx_packet_ring_addr += wl->data_path->rx_packet_ring_chunk_size; |
42 | 42 | ||
43 | wl12xx_spi_mem_read(wl, rx_packet_ring_addr, desc, sizeof(*desc)); | 43 | wl1251_spi_mem_read(wl, rx_packet_ring_addr, desc, sizeof(*desc)); |
44 | } | 44 | } |
45 | 45 | ||
46 | static void wl12xx_rx_status(struct wl12xx *wl, | 46 | static void wl1251_rx_status(struct wl1251 *wl, |
47 | struct wl12xx_rx_descriptor *desc, | 47 | struct wl1251_rx_descriptor *desc, |
48 | struct ieee80211_rx_status *status, | 48 | struct ieee80211_rx_status *status, |
49 | u8 beacon) | 49 | u8 beacon) |
50 | { | 50 | { |
@@ -65,14 +65,14 @@ static void wl12xx_rx_status(struct wl12xx *wl, | |||
65 | * this one must be atomic, while our SPI routines can sleep. | 65 | * this one must be atomic, while our SPI routines can sleep. |
66 | */ | 66 | */ |
67 | if ((wl->bss_type == BSS_TYPE_IBSS) && beacon) { | 67 | if ((wl->bss_type == BSS_TYPE_IBSS) && beacon) { |
68 | ret = wl12xx_acx_tsf_info(wl, &mactime); | 68 | ret = wl1251_acx_tsf_info(wl, &mactime); |
69 | if (ret == 0) | 69 | if (ret == 0) |
70 | status->mactime = mactime; | 70 | status->mactime = mactime; |
71 | } | 71 | } |
72 | 72 | ||
73 | status->signal = desc->rssi; | 73 | status->signal = desc->rssi; |
74 | status->qual = (desc->rssi - WL12XX_RX_MIN_RSSI) * 100 / | 74 | status->qual = (desc->rssi - WL1251_RX_MIN_RSSI) * 100 / |
75 | (WL12XX_RX_MAX_RSSI - WL12XX_RX_MIN_RSSI); | 75 | (WL1251_RX_MAX_RSSI - WL1251_RX_MIN_RSSI); |
76 | status->qual = min(status->qual, 100); | 76 | status->qual = min(status->qual, 100); |
77 | status->qual = max(status->qual, 0); | 77 | status->qual = max(status->qual, 0); |
78 | 78 | ||
@@ -103,8 +103,8 @@ static void wl12xx_rx_status(struct wl12xx *wl, | |||
103 | /* FIXME: set status->rate_idx */ | 103 | /* FIXME: set status->rate_idx */ |
104 | } | 104 | } |
105 | 105 | ||
106 | static void wl12xx_rx_body(struct wl12xx *wl, | 106 | static void wl1251_rx_body(struct wl1251 *wl, |
107 | struct wl12xx_rx_descriptor *desc) | 107 | struct wl1251_rx_descriptor *desc) |
108 | { | 108 | { |
109 | struct sk_buff *skb; | 109 | struct sk_buff *skb; |
110 | struct ieee80211_rx_status status; | 110 | struct ieee80211_rx_status status; |
@@ -112,12 +112,12 @@ static void wl12xx_rx_body(struct wl12xx *wl, | |||
112 | u16 length, *fc; | 112 | u16 length, *fc; |
113 | u32 curr_id, last_id_inc, rx_packet_ring_addr; | 113 | u32 curr_id, last_id_inc, rx_packet_ring_addr; |
114 | 114 | ||
115 | length = WL12XX_RX_ALIGN(desc->length - PLCP_HEADER_LENGTH); | 115 | length = WL1251_RX_ALIGN(desc->length - PLCP_HEADER_LENGTH); |
116 | curr_id = (desc->flags & RX_DESC_SEQNUM_MASK) >> RX_DESC_PACKETID_SHIFT; | 116 | curr_id = (desc->flags & RX_DESC_SEQNUM_MASK) >> RX_DESC_PACKETID_SHIFT; |
117 | last_id_inc = (wl->rx_last_id + 1) % (RX_MAX_PACKET_ID + 1); | 117 | last_id_inc = (wl->rx_last_id + 1) % (RX_MAX_PACKET_ID + 1); |
118 | 118 | ||
119 | if (last_id_inc != curr_id) { | 119 | if (last_id_inc != curr_id) { |
120 | wl12xx_warning("curr ID:%d, last ID inc:%d", | 120 | wl1251_warning("curr ID:%d, last ID inc:%d", |
121 | curr_id, last_id_inc); | 121 | curr_id, last_id_inc); |
122 | wl->rx_last_id = curr_id; | 122 | wl->rx_last_id = curr_id; |
123 | } else { | 123 | } else { |
@@ -125,18 +125,18 @@ static void wl12xx_rx_body(struct wl12xx *wl, | |||
125 | } | 125 | } |
126 | 126 | ||
127 | rx_packet_ring_addr = wl->data_path->rx_packet_ring_addr + | 127 | rx_packet_ring_addr = wl->data_path->rx_packet_ring_addr + |
128 | sizeof(struct wl12xx_rx_descriptor) + 20; | 128 | sizeof(struct wl1251_rx_descriptor) + 20; |
129 | if (wl->rx_current_buffer) | 129 | if (wl->rx_current_buffer) |
130 | rx_packet_ring_addr += wl->data_path->rx_packet_ring_chunk_size; | 130 | rx_packet_ring_addr += wl->data_path->rx_packet_ring_chunk_size; |
131 | 131 | ||
132 | skb = dev_alloc_skb(length); | 132 | skb = dev_alloc_skb(length); |
133 | if (!skb) { | 133 | if (!skb) { |
134 | wl12xx_error("Couldn't allocate RX frame"); | 134 | wl1251_error("Couldn't allocate RX frame"); |
135 | return; | 135 | return; |
136 | } | 136 | } |
137 | 137 | ||
138 | rx_buffer = skb_put(skb, length); | 138 | rx_buffer = skb_put(skb, length); |
139 | wl12xx_spi_mem_read(wl, rx_packet_ring_addr, rx_buffer, length); | 139 | wl1251_spi_mem_read(wl, rx_packet_ring_addr, rx_buffer, length); |
140 | 140 | ||
141 | /* The actual lenght doesn't include the target's alignment */ | 141 | /* The actual lenght doesn't include the target's alignment */ |
142 | skb->len = desc->length - PLCP_HEADER_LENGTH; | 142 | skb->len = desc->length - PLCP_HEADER_LENGTH; |
@@ -146,15 +146,15 @@ static void wl12xx_rx_body(struct wl12xx *wl, | |||
146 | if ((*fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) | 146 | if ((*fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) |
147 | beacon = 1; | 147 | beacon = 1; |
148 | 148 | ||
149 | wl12xx_rx_status(wl, desc, &status, beacon); | 149 | wl1251_rx_status(wl, desc, &status, beacon); |
150 | 150 | ||
151 | wl12xx_debug(DEBUG_RX, "rx skb 0x%p: %d B %s", skb, skb->len, | 151 | wl1251_debug(DEBUG_RX, "rx skb 0x%p: %d B %s", skb, skb->len, |
152 | beacon ? "beacon" : ""); | 152 | beacon ? "beacon" : ""); |
153 | 153 | ||
154 | ieee80211_rx(wl->hw, skb, &status); | 154 | ieee80211_rx(wl->hw, skb, &status); |
155 | } | 155 | } |
156 | 156 | ||
157 | static void wl12xx_rx_ack(struct wl12xx *wl) | 157 | static void wl1251_rx_ack(struct wl1251 *wl) |
158 | { | 158 | { |
159 | u32 data, addr; | 159 | u32 data, addr; |
160 | 160 | ||
@@ -166,30 +166,30 @@ static void wl12xx_rx_ack(struct wl12xx *wl) | |||
166 | data = INTR_TRIG_RX_PROC0; | 166 | data = INTR_TRIG_RX_PROC0; |
167 | } | 167 | } |
168 | 168 | ||
169 | wl12xx_reg_write32(wl, addr, data); | 169 | wl1251_reg_write32(wl, addr, data); |
170 | 170 | ||
171 | /* Toggle buffer ring */ | 171 | /* Toggle buffer ring */ |
172 | wl->rx_current_buffer = !wl->rx_current_buffer; | 172 | wl->rx_current_buffer = !wl->rx_current_buffer; |
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | void wl12xx_rx(struct wl12xx *wl) | 176 | void wl1251_rx(struct wl1251 *wl) |
177 | { | 177 | { |
178 | struct wl12xx_rx_descriptor *rx_desc; | 178 | struct wl1251_rx_descriptor *rx_desc; |
179 | 179 | ||
180 | if (wl->state != WL12XX_STATE_ON) | 180 | if (wl->state != WL1251_STATE_ON) |
181 | return; | 181 | return; |
182 | 182 | ||
183 | rx_desc = wl->rx_descriptor; | 183 | rx_desc = wl->rx_descriptor; |
184 | 184 | ||
185 | /* We first read the frame's header */ | 185 | /* We first read the frame's header */ |
186 | wl12xx_rx_header(wl, rx_desc); | 186 | wl1251_rx_header(wl, rx_desc); |
187 | 187 | ||
188 | /* Now we can read the body */ | 188 | /* Now we can read the body */ |
189 | wl12xx_rx_body(wl, rx_desc); | 189 | wl1251_rx_body(wl, rx_desc); |
190 | 190 | ||
191 | /* Finally, we need to ACK the RX */ | 191 | /* Finally, we need to ACK the RX */ |
192 | wl12xx_rx_ack(wl); | 192 | wl1251_rx_ack(wl); |
193 | 193 | ||
194 | return; | 194 | return; |
195 | } | 195 | } |