aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2014-02-19 03:15:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-24 15:21:55 -0500
commit8e67427aca2f0dda148181af930732734f6e2e42 (patch)
tree600d875b2c0f3e93db7ceda4fb99908fcb472959 /drivers/net
parent59f01183a7846c1621a23dd88182f5a890f38717 (diff)
iwlegacy: merge reclaim check
Merge reclaim check for 3945 & 4965. This add some more checks for 3945, most importantly N_RX notify. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c9
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c12
-rw-r--r--drivers/net/wireless/iwlegacy/common.h14
3 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 46b32d41aa2f..dc1d20cf64ee 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -1248,14 +1248,7 @@ il3945_rx_handle(struct il_priv *il)
1248 len = le32_to_cpu(pkt->len_n_flags) & IL_RX_FRAME_SIZE_MSK; 1248 len = le32_to_cpu(pkt->len_n_flags) & IL_RX_FRAME_SIZE_MSK;
1249 len += sizeof(u32); /* account for status word */ 1249 len += sizeof(u32); /* account for status word */
1250 1250
1251 /* Reclaim a command buffer only if this packet is a response 1251 reclaim = il_need_reclaim(il, pkt);
1252 * to a (driver-originated) command.
1253 * If the packet (e.g. Rx frame) originated from uCode,
1254 * there is no command buffer to reclaim.
1255 * Ucode should set SEQ_RX_FRAME bit if ucode-originated,
1256 * but apparently a few don't get set; catch them here. */
1257 reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
1258 pkt->hdr.cmd != N_STATS && pkt->hdr.cmd != C_TX;
1259 1252
1260 /* Based on type of command response or notification, 1253 /* Based on type of command response or notification,
1261 * handle those that need handling via function in 1254 * handle those that need handling via function in
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 43f488a8cda2..50673f7e30bc 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -4274,17 +4274,7 @@ il4965_rx_handle(struct il_priv *il)
4274 len = le32_to_cpu(pkt->len_n_flags) & IL_RX_FRAME_SIZE_MSK; 4274 len = le32_to_cpu(pkt->len_n_flags) & IL_RX_FRAME_SIZE_MSK;
4275 len += sizeof(u32); /* account for status word */ 4275 len += sizeof(u32); /* account for status word */
4276 4276
4277 /* Reclaim a command buffer only if this packet is a response 4277 reclaim = il_need_reclaim(il, pkt);
4278 * to a (driver-originated) command.
4279 * If the packet (e.g. Rx frame) originated from uCode,
4280 * there is no command buffer to reclaim.
4281 * Ucode should set SEQ_RX_FRAME bit if ucode-originated,
4282 * but apparently a few don't get set; catch them here. */
4283 reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
4284 (pkt->hdr.cmd != N_RX_PHY) && (pkt->hdr.cmd != N_RX) &&
4285 (pkt->hdr.cmd != N_RX_MPDU) &&
4286 (pkt->hdr.cmd != N_COMPRESSED_BA) &&
4287 (pkt->hdr.cmd != N_STATS) && (pkt->hdr.cmd != C_TX);
4288 4278
4289 /* Based on type of command response or notification, 4279 /* Based on type of command response or notification,
4290 * handle those that need handling via function in 4280 * handle those that need handling via function in
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index ad123d66ab6c..21964d2cad83 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1978,6 +1978,20 @@ void il_wr_prph(struct il_priv *il, u32 addr, u32 val);
1978u32 il_read_targ_mem(struct il_priv *il, u32 addr); 1978u32 il_read_targ_mem(struct il_priv *il, u32 addr);
1979void il_write_targ_mem(struct il_priv *il, u32 addr, u32 val); 1979void il_write_targ_mem(struct il_priv *il, u32 addr, u32 val);
1980 1980
1981static inline bool il_need_reclaim(struct il_priv *il, struct il_rx_pkt *pkt)
1982{
1983 /* Reclaim a command buffer only if this packet is a response
1984 * to a (driver-originated) command. If the packet (e.g. Rx frame)
1985 * originated from uCode, there is no command buffer to reclaim.
1986 * Ucode should set SEQ_RX_FRAME bit if ucode-originated, but
1987 * apparently a few don't get set; catch them here.
1988 */
1989 return !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
1990 pkt->hdr.cmd != N_STATS && pkt->hdr.cmd != C_TX &&
1991 pkt->hdr.cmd != N_RX_PHY && pkt->hdr.cmd != N_RX &&
1992 pkt->hdr.cmd != N_RX_MPDU && pkt->hdr.cmd != N_COMPRESSED_BA;
1993}
1994
1981static inline void 1995static inline void
1982_il_write8(struct il_priv *il, u32 ofs, u8 val) 1996_il_write8(struct il_priv *il, u32 ofs, u8 val)
1983{ 1997{