Changeset 35621
- Timestamp:
- 2013-02-16T15:38:17+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/target/linux/brcm47xx/patches-3.6/760-bgmac-fixes.patch
r35574 r35621 1 1 --- a/drivers/net/ethernet/broadcom/bgmac.c 2 2 +++ b/drivers/net/ethernet/broadcom/bgmac.c 3 @@ -761,6 +761,26 @@ static void bgmac_cmdcfg_maskset(struct 3 @@ -301,8 +301,9 @@ static int bgmac_dma_rx_read(struct bgma 4 bgmac_err(bgmac, "Found poisoned packet at slot %d, DMA issue!\n", 5 ring->start); 6 } else { 7 - new_skb = netdev_alloc_skb(bgmac->net_dev, len); 8 + new_skb = netdev_alloc_skb(bgmac->net_dev, len + 2); 9 if (new_skb) { 10 + skb_reserve(new_skb, 2); 11 skb_put(new_skb, len); 12 skb_copy_from_linear_data_offset(skb, BGMAC_RX_FRAME_OFFSET, 13 new_skb->data, 14 @@ -535,7 +536,7 @@ static void bgmac_dma_init(struct bgmac 15 * PHY ops 16 **************************************************/ 17 18 -u16 bgmac_phy_read(struct bgmac *bgmac, u8 phyaddr, u8 reg) 19 +static u16 bgmac_phy_read(struct bgmac *bgmac, u8 phyaddr, u8 reg) 20 { 21 struct bcma_device *core; 22 u16 phy_access_addr; 23 @@ -584,7 +585,7 @@ u16 bgmac_phy_read(struct bgmac *bgmac, 24 } 25 26 /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipphywr */ 27 -void bgmac_phy_write(struct bgmac *bgmac, u8 phyaddr, u8 reg, u16 value) 28 +static int bgmac_phy_write(struct bgmac *bgmac, u8 phyaddr, u8 reg, u16 value) 29 { 30 struct bcma_device *core; 31 u16 phy_access_addr; 32 @@ -617,9 +618,13 @@ void bgmac_phy_write(struct bgmac *bgmac 33 tmp |= value; 34 bcma_write32(core, phy_access_addr, tmp); 35 36 - if (!bgmac_wait_value(core, phy_access_addr, BGMAC_PA_START, 0, 1000)) 37 + if (!bgmac_wait_value(core, phy_access_addr, BGMAC_PA_START, 0, 1000)) { 38 bgmac_err(bgmac, "Writing to PHY %d register 0x%X failed\n", 39 phyaddr, reg); 40 + return -ETIMEDOUT; 41 + } 42 + 43 + return 0; 44 } 45 46 /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipphyforce */ 47 @@ -761,6 +766,26 @@ static void bgmac_cmdcfg_maskset(struct 4 48 udelay(2); 5 49 } … … 28 72 static void bgmac_chip_stats_update(struct bgmac *bgmac) 29 73 { 30 @@ -889,8 +9 09,10 @@ static void bgmac_chip_reset(struct bgma74 @@ -889,8 +914,10 @@ static void bgmac_chip_reset(struct bgma 31 75 sw_type = et_swtype; 32 76 } else if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == 9) { … … 41 85 bcma_chipco_chipctl_maskset(cc, 1, 42 86 ~(BGMAC_CHIPCTL_1_IF_TYPE_MASK | 43 @@ -948,6 +97 0,7 @@ static void bgmac_chip_intrs_on(struct b87 @@ -948,6 +975,7 @@ static void bgmac_chip_intrs_on(struct b 44 88 static void bgmac_chip_intrs_off(struct bgmac *bgmac) 45 89 { … … 49 93 50 94 /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/gmac_enable */ 51 @@ -1004,8 +10 27,6 @@ static void bgmac_enable(struct bgmac *b95 @@ -1004,8 +1032,6 @@ static void bgmac_enable(struct bgmac *b 52 96 static void bgmac_chip_init(struct bgmac *bgmac, bool full_init) 53 97 { … … 58 102 59 103 /* 1 interrupt per received frame */ 60 @@ -1014,21 +10 35,14 @@ static void bgmac_chip_init(struct bgmac104 @@ -1014,21 +1040,14 @@ static void bgmac_chip_init(struct bgmac 61 105 /* Enable 802.3x tx flow control (honor received PAUSE frames) */ 62 106 bgmac_cmdcfg_maskset(bgmac, ~BGMAC_CMDCFG_RPI, 0, true); … … 84 128 bgmac_write(bgmac, BGMAC_RXMAX_LENGTH, 32 + ETHER_MAX_LEN); 85 129 86 @@ -1160,6 +117 4,19 @@ static netdev_tx_t bgmac_start_xmit(stru130 @@ -1160,6 +1179,19 @@ static netdev_tx_t bgmac_start_xmit(stru 87 131 return bgmac_dma_tx_add(bgmac, ring, skb); 88 132 } … … 104 148 { 105 149 struct bgmac *bgmac = netdev_priv(net_dev); 106 @@ -1190,7 +12 17,9 @@ static const struct net_device_ops bgmac150 @@ -1190,7 +1222,9 @@ static const struct net_device_ops bgmac 107 151 .ndo_open = bgmac_open, 108 152 .ndo_stop = bgmac_stop, … … 115 159 }; 116 160 117 @@ -1290,6 +13 19,12 @@ static int bgmac_probe(struct bcma_devic161 @@ -1290,6 +1324,12 @@ static int bgmac_probe(struct bcma_devic 118 162 return -ENOTSUPP; 119 163 } … … 139 183 140 184 #define BGMAC_SPEED_10 0x0001 185 @@ -450,7 +450,4 @@ static inline void bgmac_set(struct bgma 186 bgmac_maskset(bgmac, offset, ~0, set); 187 } 188 189 -u16 bgmac_phy_read(struct bgmac *bgmac, u8 phyaddr, u8 reg); 190 -void bgmac_phy_write(struct bgmac *bgmac, u8 phyaddr, u8 reg, u16 value); 191 - 192 #endif /* _BGMAC_H */
Note: See TracChangeset
for help on using the changeset viewer.