Add flashmap support for AMIT and Zyxel boards, thanks sn9
[openwrt.git] / target / linux / atheros / patches-2.6.27 / 200-ar2313_enable_mvswitch.patch
1 --- a/drivers/net/ar2313/ar2313.c
2 +++ b/drivers/net/ar2313/ar2313.c
3 @@ -834,6 +834,7 @@ static void ar2313_load_rx_ring(struct n
4 for (i = 0; i < nr_bufs; i++) {
5 struct sk_buff *skb;
6 ar2313_descr_t *rd;
7 + int offset = RX_OFFSET;
8
9 if (sp->rx_skb[idx]) {
10 #if DEBUG_RX
11 @@ -855,7 +856,9 @@ static void ar2313_load_rx_ring(struct n
12 * Make sure IP header starts on a fresh cache line.
13 */
14 skb->dev = dev;
15 - skb_reserve(skb, RX_OFFSET);
16 + if (sp->phy_dev)
17 + offset += sp->phy_dev->pkt_align;
18 + skb_reserve(skb, offset);
19 sp->rx_skb[idx] = skb;
20
21 rd = (ar2313_descr_t *) & sp->rx_ring[idx];
22 @@ -946,6 +949,7 @@ static int ar2313_rx_int(struct net_devi
23 /* alloc new buffer. */
24 skb_new = dev_alloc_skb(AR2313_BUFSIZE + RX_OFFSET + 128);
25 if (skb_new != NULL) {
26 + int offset;
27
28 skb = sp->rx_skb[idx];
29 /* set skb */
30 @@ -953,13 +957,17 @@ static int ar2313_rx_int(struct net_devi
31 ((status >> DMA_RX_LEN_SHIFT) & 0x3fff) - CRC_LEN);
32
33 dev->stats.rx_bytes += skb->len;
34 - skb->protocol = eth_type_trans(skb, dev);
35 +
36 /* pass the packet to upper layers */
37 - netif_rx(skb);
38 + sp->rx(skb);
39
40 skb_new->dev = dev;
41 +
42 /* 16 bit align */
43 - skb_reserve(skb_new, RX_OFFSET + 32);
44 + offset = RX_OFFSET + 32;
45 + if (sp->phy_dev)
46 + offset += sp->phy_dev->pkt_align;
47 + skb_reserve(skb_new, offset);
48 /* reset descriptor's curr_addr */
49 rxdesc->addr = virt_to_phys(skb_new->data);
50
51 @@ -1370,6 +1378,8 @@ static int mdiobus_probe (struct net_dev
52 return PTR_ERR(phydev);
53 }
54
55 + sp->rx = phydev->netif_rx;
56 +
57 /* mask with MAC supported features */
58 phydev->supported &= (SUPPORTED_10baseT_Half
59 | SUPPORTED_10baseT_Full
60 --- a/drivers/net/ar2313/ar2313.h
61 +++ b/drivers/net/ar2313/ar2313.h
62 @@ -107,6 +107,8 @@ typedef struct {
63 */
64 struct ar2313_private {
65 struct net_device *dev;
66 + int (*rx)(struct sk_buff *skb);
67 +
68 int version;
69 u32 mb[2];
70
This page took 0.042425 seconds and 5 git commands to generate.