diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-05-10 12:13:24 +0300 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-06-05 15:55:10 +0300 |
commit | 30e2dd798dbd5929f981ec0c77ab8567e8859ad9 (patch) | |
tree | 5cd14a32f8571e22d9987bd7d7a97099be13d263 /drivers/net/wireless/ti/wl18xx/main.c | |
parent | 9c809f888370d87129d17028d515bb025fe94175 (diff) | |
download | lwn-30e2dd798dbd5929f981ec0c77ab8567e8859ad9.tar.gz lwn-30e2dd798dbd5929f981ec0c77ab8567e8859ad9.zip |
wl18xx: implement hw op for getting rx packet data length
Implement the 18xx-specific way for getting the length of a Rx packet.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index fef872608e00..40ed53c02866 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c @@ -458,6 +458,17 @@ wl18xx_get_rx_buf_align(struct wl1271 *wl, u32 rx_desc) return WLCORE_RX_BUF_ALIGNED; } +static u32 wl18xx_get_rx_packet_len(struct wl1271 *wl, void *rx_data, + u32 data_len) +{ + struct wl1271_rx_descriptor *desc = rx_data; + + /* invalid packet */ + if (data_len < sizeof(*desc)) + return 0; + + return data_len - sizeof(*desc); +} static struct wlcore_ops wl18xx_ops = { .identify_chip = wl18xx_identify_chip, @@ -468,6 +479,7 @@ static struct wlcore_ops wl18xx_ops = { .set_tx_desc_blocks = wl18xx_set_tx_desc_blocks, .set_tx_desc_data_len = wl18xx_set_tx_desc_data_len, .get_rx_buf_align = wl18xx_get_rx_buf_align, + .get_rx_packet_len = wl18xx_get_rx_packet_len, }; int __devinit wl18xx_probe(struct platform_device *pdev) |