ar71xx: fix register range check for DMA stuck checks (thx, Frédéric Moulins), backpo...
[openwrt-10.03/.git] / target / linux / ar71xx / files / drivers / net / ag71xx / ag71xx_ar8216.c
index 39221ad62cde7b5f77addf8e5980b30a81df9e71..7ec43b722173ff6703ce8c5ec1a678e3d44e0178 100644 (file)
@@ -2,7 +2,7 @@
  *  Atheros AR71xx built-in ethernet mac driver
  *  Special support for the Atheros ar8216 switch chip
  *
- *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
  *
  *  Based on Atheros' AG7100 driver
  *
 
 void ag71xx_add_ar8216_header(struct ag71xx *ag, struct sk_buff *skb)
 {
-       struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
-
-       if (!pdata->has_ar8216)
-               return;
-
-        skb_push(skb, AR8216_HEADER_LEN);
-        skb->data[0] = 0x10;
-        skb->data[1] = 0x80;
+       skb_push(skb, AR8216_HEADER_LEN);
+       skb->data[0] = 0x10;
+       skb->data[1] = 0x80;
 }
 
-int ag71xx_remove_ar8216_header(struct ag71xx *ag,
-                               struct sk_buff *skb)
+int ag71xx_remove_ar8216_header(struct ag71xx *ag, struct sk_buff *skb,
+                               int pktlen)
 {
-       struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
        u8 type;
 
-       if (!pdata->has_ar8216)
-               return 0;
-
        type = skb->data[1] & AR8216_PACKET_TYPE_MASK;
-
        switch (type) {
        case AR8216_PACKET_TYPE_NORMAL:
-               skb_pull(skb, AR8216_HEADER_LEN);
                break;
+
        default:
                return -EINVAL;
        }
 
+       skb_pull(skb, AR8216_HEADER_LEN);
        return 0;
 }