diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2014-02-19 09:15:10 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-24 15:21:55 -0500 |
commit | 8e67427aca2f0dda148181af930732734f6e2e42 (patch) | |
tree | 600d875b2c0f3e93db7ceda4fb99908fcb472959 /drivers/net/wireless/iwlegacy/common.h | |
parent | 59f01183a7846c1621a23dd88182f5a890f38717 (diff) | |
download | op-kernel-dev-8e67427aca2f0dda148181af930732734f6e2e42.zip op-kernel-dev-8e67427aca2f0dda148181af930732734f6e2e42.tar.gz |
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/wireless/iwlegacy/common.h')
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h index ad123d6..21964d2 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); u32 il_read_targ_mem(struct il_priv *il, u32 addr); void il_write_targ_mem(struct il_priv *il, u32 addr, u32 val); +static inline bool il_need_reclaim(struct il_priv *il, struct il_rx_pkt *pkt) +{ + /* Reclaim a command buffer only if this packet is a response + * to a (driver-originated) command. If the packet (e.g. Rx frame) + * originated from uCode, there is no command buffer to reclaim. + * Ucode should set SEQ_RX_FRAME bit if ucode-originated, but + * apparently a few don't get set; catch them here. + */ + return !(pkt->hdr.sequence & SEQ_RX_FRAME) && + pkt->hdr.cmd != N_STATS && pkt->hdr.cmd != C_TX && + pkt->hdr.cmd != N_RX_PHY && pkt->hdr.cmd != N_RX && + pkt->hdr.cmd != N_RX_MPDU && pkt->hdr.cmd != N_COMPRESSED_BA; +} + static inline void _il_write8(struct il_priv *il, u32 ofs, u8 val) { |