2 * Atheros AR71xx built-in ethernet mac driver
3 * Special support for the Atheros ar8216 switch chip
5 * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
7 * Based on Atheros' AG7100 driver
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
16 #define AR8216_PACKET_TYPE_MASK 0xf
17 #define AR8216_PACKET_TYPE_NORMAL 0
19 #define AR8216_HEADER_LEN 2
21 void ag71xx_add_ar8216_header(struct ag71xx
*ag
, struct sk_buff
*skb
)
23 struct ag71xx_platform_data
*pdata
= ag71xx_get_pdata(ag
);
25 if (!pdata
->has_ar8216
)
28 skb_push(skb
, AR8216_HEADER_LEN
);
33 int ag71xx_remove_ar8216_header(struct ag71xx
*ag
,
36 struct ag71xx_platform_data
*pdata
= ag71xx_get_pdata(ag
);
39 if (!pdata
->has_ar8216
)
42 type
= skb
->data
[1] & AR8216_PACKET_TYPE_MASK
;
45 case AR8216_PACKET_TYPE_NORMAL
:
46 skb_pull(skb
, AR8216_HEADER_LEN
);