aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sunbmac.c154
-rw-r--r--drivers/net/sunbmac.h4
2 files changed, 70 insertions, 88 deletions
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 8fe4c49b0623..7009a5e36c97 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -1,7 +1,6 @@
1/* $Id: sunbmac.c,v 1.30 2002/01/15 06:48:55 davem Exp $ 1/* sunbmac.c: Driver for Sparc BigMAC 100baseT ethernet adapters.
2 * sunbmac.c: Driver for Sparc BigMAC 100baseT ethernet adapters.
3 * 2 *
4 * Copyright (C) 1997, 1998, 1999, 2003 David S. Miller (davem@redhat.com) 3 * Copyright (C) 1997, 1998, 1999, 2003, 2008 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5
7#include <linux/module.h> 6#include <linux/module.h>
@@ -24,6 +23,8 @@
24#include <linux/skbuff.h> 23#include <linux/skbuff.h>
25#include <linux/bitops.h> 24#include <linux/bitops.h>
26#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26#include <linux/of.h>
27#include <linux/of_device.h>
27 28
28#include <asm/auxio.h> 29#include <asm/auxio.h>
29#include <asm/byteorder.h> 30#include <asm/byteorder.h>
@@ -33,15 +34,14 @@
33#include <asm/openprom.h> 34#include <asm/openprom.h>
34#include <asm/oplib.h> 35#include <asm/oplib.h>
35#include <asm/pgtable.h> 36#include <asm/pgtable.h>
36#include <asm/sbus.h>
37#include <asm/system.h> 37#include <asm/system.h>
38 38
39#include "sunbmac.h" 39#include "sunbmac.h"
40 40
41#define DRV_NAME "sunbmac" 41#define DRV_NAME "sunbmac"
42#define DRV_VERSION "2.0" 42#define DRV_VERSION "2.1"
43#define DRV_RELDATE "11/24/03" 43#define DRV_RELDATE "August 26, 2008"
44#define DRV_AUTHOR "David S. Miller (davem@redhat.com)" 44#define DRV_AUTHOR "David S. Miller (davem@davemloft.net)"
45 45
46static char version[] = 46static char version[] =
47 DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n"; 47 DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n";
@@ -97,8 +97,8 @@ static int qec_global_reset(void __iomem *gregs)
97 97
98static void qec_init(struct bigmac *bp) 98static void qec_init(struct bigmac *bp)
99{ 99{
100 struct of_device *qec_op = bp->qec_op;
100 void __iomem *gregs = bp->gregs; 101 void __iomem *gregs = bp->gregs;
101 struct sbus_dev *qec_sdev = bp->qec_sdev;
102 u8 bsizes = bp->bigmac_bursts; 102 u8 bsizes = bp->bigmac_bursts;
103 u32 regval; 103 u32 regval;
104 104
@@ -113,13 +113,13 @@ static void qec_init(struct bigmac *bp)
113 sbus_writel(GLOB_PSIZE_2048, gregs + GLOB_PSIZE); 113 sbus_writel(GLOB_PSIZE_2048, gregs + GLOB_PSIZE);
114 114
115 /* All of memsize is given to bigmac. */ 115 /* All of memsize is given to bigmac. */
116 sbus_writel(qec_sdev->reg_addrs[1].reg_size, 116 sbus_writel(resource_size(&qec_op->resource[1]),
117 gregs + GLOB_MSIZE); 117 gregs + GLOB_MSIZE);
118 118
119 /* Half to the transmitter, half to the receiver. */ 119 /* Half to the transmitter, half to the receiver. */
120 sbus_writel(qec_sdev->reg_addrs[1].reg_size >> 1, 120 sbus_writel(resource_size(&qec_op->resource[1]) >> 1,
121 gregs + GLOB_TSIZE); 121 gregs + GLOB_TSIZE);
122 sbus_writel(qec_sdev->reg_addrs[1].reg_size >> 1, 122 sbus_writel(resource_size(&qec_op->resource[1]) >> 1,
123 gregs + GLOB_RSIZE); 123 gregs + GLOB_RSIZE);
124} 124}
125 125
@@ -240,7 +240,7 @@ static void bigmac_init_rings(struct bigmac *bp, int from_irq)
240 skb_reserve(skb, 34); 240 skb_reserve(skb, 34);
241 241
242 bb->be_rxd[i].rx_addr = 242 bb->be_rxd[i].rx_addr =
243 dma_map_single(&bp->bigmac_sdev->ofdev.dev, 243 dma_map_single(&bp->bigmac_op->dev,
244 skb->data, 244 skb->data,
245 RX_BUF_ALLOC_SIZE - 34, 245 RX_BUF_ALLOC_SIZE - 34,
246 DMA_FROM_DEVICE); 246 DMA_FROM_DEVICE);
@@ -778,7 +778,7 @@ static void bigmac_tx(struct bigmac *bp)
778 skb = bp->tx_skbs[elem]; 778 skb = bp->tx_skbs[elem];
779 bp->enet_stats.tx_packets++; 779 bp->enet_stats.tx_packets++;
780 bp->enet_stats.tx_bytes += skb->len; 780 bp->enet_stats.tx_bytes += skb->len;
781 dma_unmap_single(&bp->bigmac_sdev->ofdev.dev, 781 dma_unmap_single(&bp->bigmac_op->dev,
782 this->tx_addr, skb->len, 782 this->tx_addr, skb->len,
783 DMA_TO_DEVICE); 783 DMA_TO_DEVICE);
784 784
@@ -833,7 +833,7 @@ static void bigmac_rx(struct bigmac *bp)
833 drops++; 833 drops++;
834 goto drop_it; 834 goto drop_it;
835 } 835 }
836 dma_unmap_single(&bp->bigmac_sdev->ofdev.dev, 836 dma_unmap_single(&bp->bigmac_op->dev,
837 this->rx_addr, 837 this->rx_addr,
838 RX_BUF_ALLOC_SIZE - 34, 838 RX_BUF_ALLOC_SIZE - 34,
839 DMA_FROM_DEVICE); 839 DMA_FROM_DEVICE);
@@ -842,7 +842,7 @@ static void bigmac_rx(struct bigmac *bp)
842 skb_put(new_skb, ETH_FRAME_LEN); 842 skb_put(new_skb, ETH_FRAME_LEN);
843 skb_reserve(new_skb, 34); 843 skb_reserve(new_skb, 34);
844 this->rx_addr = 844 this->rx_addr =
845 dma_map_single(&bp->bigmac_sdev->ofdev.dev, 845 dma_map_single(&bp->bigmac_op->dev,
846 new_skb->data, 846 new_skb->data,
847 RX_BUF_ALLOC_SIZE - 34, 847 RX_BUF_ALLOC_SIZE - 34,
848 DMA_FROM_DEVICE); 848 DMA_FROM_DEVICE);
@@ -860,11 +860,11 @@ static void bigmac_rx(struct bigmac *bp)
860 } 860 }
861 skb_reserve(copy_skb, 2); 861 skb_reserve(copy_skb, 2);
862 skb_put(copy_skb, len); 862 skb_put(copy_skb, len);
863 dma_sync_single_for_cpu(&bp->bigmac_sdev->ofdev.dev, 863 dma_sync_single_for_cpu(&bp->bigmac_op->dev,
864 this->rx_addr, len, 864 this->rx_addr, len,
865 DMA_FROM_DEVICE); 865 DMA_FROM_DEVICE);
866 skb_copy_to_linear_data(copy_skb, (unsigned char *)skb->data, len); 866 skb_copy_to_linear_data(copy_skb, (unsigned char *)skb->data, len);
867 dma_sync_single_for_device(&bp->bigmac_sdev->ofdev.dev, 867 dma_sync_single_for_device(&bp->bigmac_op->dev,
868 this->rx_addr, len, 868 this->rx_addr, len,
869 DMA_FROM_DEVICE); 869 DMA_FROM_DEVICE);
870 870
@@ -962,7 +962,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
962 u32 mapping; 962 u32 mapping;
963 963
964 len = skb->len; 964 len = skb->len;
965 mapping = dma_map_single(&bp->bigmac_sdev->ofdev.dev, skb->data, 965 mapping = dma_map_single(&bp->bigmac_op->dev, skb->data,
966 len, DMA_TO_DEVICE); 966 len, DMA_TO_DEVICE);
967 967
968 /* Avoid a race... */ 968 /* Avoid a race... */
@@ -1055,12 +1055,8 @@ static void bigmac_set_multicast(struct net_device *dev)
1055/* Ethtool support... */ 1055/* Ethtool support... */
1056static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 1056static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1057{ 1057{
1058 struct bigmac *bp = dev->priv;
1059
1060 strcpy(info->driver, "sunbmac"); 1058 strcpy(info->driver, "sunbmac");
1061 strcpy(info->version, "2.0"); 1059 strcpy(info->version, "2.0");
1062 sprintf(info->bus_info, "SBUS:%d",
1063 bp->qec_sdev->slot);
1064} 1060}
1065 1061
1066static u32 bigmac_get_link(struct net_device *dev) 1062static u32 bigmac_get_link(struct net_device *dev)
@@ -1079,14 +1075,15 @@ static const struct ethtool_ops bigmac_ethtool_ops = {
1079 .get_link = bigmac_get_link, 1075 .get_link = bigmac_get_link,
1080}; 1076};
1081 1077
1082static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev) 1078static int __devinit bigmac_ether_init(struct of_device *op,
1079 struct of_device *qec_op)
1083{ 1080{
1084 struct net_device *dev;
1085 static int version_printed; 1081 static int version_printed;
1086 struct bigmac *bp; 1082 struct net_device *dev;
1087 u8 bsizes, bsizes_more; 1083 u8 bsizes, bsizes_more;
1088 int i;
1089 DECLARE_MAC_BUF(mac); 1084 DECLARE_MAC_BUF(mac);
1085 struct bigmac *bp;
1086 int i;
1090 1087
1091 /* Get a new device struct for this interface. */ 1088 /* Get a new device struct for this interface. */
1092 dev = alloc_etherdev(sizeof(struct bigmac)); 1089 dev = alloc_etherdev(sizeof(struct bigmac));
@@ -1096,32 +1093,21 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1096 if (version_printed++ == 0) 1093 if (version_printed++ == 0)
1097 printk(KERN_INFO "%s", version); 1094 printk(KERN_INFO "%s", version);
1098 1095
1099 dev->base_addr = (long) qec_sdev;
1100 for (i = 0; i < 6; i++) 1096 for (i = 0; i < 6; i++)
1101 dev->dev_addr[i] = idprom->id_ethaddr[i]; 1097 dev->dev_addr[i] = idprom->id_ethaddr[i];
1102 1098
1103 /* Setup softc, with backpointers to QEC and BigMAC SBUS device structs. */ 1099 /* Setup softc, with backpointers to QEC and BigMAC SBUS device structs. */
1104 bp = dev->priv; 1100 bp = netdev_priv(dev);
1105 bp->qec_sdev = qec_sdev; 1101 bp->qec_op = qec_op;
1106 bp->bigmac_sdev = qec_sdev->child; 1102 bp->bigmac_op = op;
1107 1103
1108 SET_NETDEV_DEV(dev, &bp->bigmac_sdev->ofdev.dev); 1104 SET_NETDEV_DEV(dev, &op->dev);
1109 1105
1110 spin_lock_init(&bp->lock); 1106 spin_lock_init(&bp->lock);
1111 1107
1112 /* Verify the registers we expect, are actually there. */
1113 if ((bp->bigmac_sdev->num_registers != 3) ||
1114 (bp->qec_sdev->num_registers != 2)) {
1115 printk(KERN_ERR "BIGMAC: Device does not have 2 and 3 regs, it has %d and %d.\n",
1116 bp->qec_sdev->num_registers,
1117 bp->bigmac_sdev->num_registers);
1118 printk(KERN_ERR "BIGMAC: Would you like that for here or to go?\n");
1119 goto fail_and_cleanup;
1120 }
1121
1122 /* Map in QEC global control registers. */ 1108 /* Map in QEC global control registers. */
1123 bp->gregs = sbus_ioremap(&bp->qec_sdev->resource[0], 0, 1109 bp->gregs = of_ioremap(&qec_op->resource[0], 0,
1124 GLOB_REG_SIZE, "BigMAC QEC GLobal Regs"); 1110 GLOB_REG_SIZE, "BigMAC QEC GLobal Regs");
1125 if (!bp->gregs) { 1111 if (!bp->gregs) {
1126 printk(KERN_ERR "BIGMAC: Cannot map QEC global registers.\n"); 1112 printk(KERN_ERR "BIGMAC: Cannot map QEC global registers.\n");
1127 goto fail_and_cleanup; 1113 goto fail_and_cleanup;
@@ -1138,13 +1124,8 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1138 goto fail_and_cleanup; 1124 goto fail_and_cleanup;
1139 1125
1140 /* Get supported SBUS burst sizes. */ 1126 /* Get supported SBUS burst sizes. */
1141 bsizes = prom_getintdefault(bp->qec_sdev->prom_node, 1127 bsizes = of_getintprop_default(qec_op->node, "burst-sizes", 0xff);
1142 "burst-sizes", 1128 bsizes_more = of_getintprop_default(qec_op->node, "burst-sizes", 0xff);
1143 0xff);
1144
1145 bsizes_more = prom_getintdefault(bp->qec_sdev->bus->prom_node,
1146 "burst-sizes",
1147 0xff);
1148 1129
1149 bsizes &= 0xff; 1130 bsizes &= 0xff;
1150 if (bsizes_more != 0xff) 1131 if (bsizes_more != 0xff)
@@ -1158,16 +1139,16 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1158 qec_init(bp); 1139 qec_init(bp);
1159 1140
1160 /* Map in the BigMAC channel registers. */ 1141 /* Map in the BigMAC channel registers. */
1161 bp->creg = sbus_ioremap(&bp->bigmac_sdev->resource[0], 0, 1142 bp->creg = of_ioremap(&op->resource[0], 0,
1162 CREG_REG_SIZE, "BigMAC QEC Channel Regs"); 1143 CREG_REG_SIZE, "BigMAC QEC Channel Regs");
1163 if (!bp->creg) { 1144 if (!bp->creg) {
1164 printk(KERN_ERR "BIGMAC: Cannot map QEC channel registers.\n"); 1145 printk(KERN_ERR "BIGMAC: Cannot map QEC channel registers.\n");
1165 goto fail_and_cleanup; 1146 goto fail_and_cleanup;
1166 } 1147 }
1167 1148
1168 /* Map in the BigMAC control registers. */ 1149 /* Map in the BigMAC control registers. */
1169 bp->bregs = sbus_ioremap(&bp->bigmac_sdev->resource[1], 0, 1150 bp->bregs = of_ioremap(&op->resource[1], 0,
1170 BMAC_REG_SIZE, "BigMAC Primary Regs"); 1151 BMAC_REG_SIZE, "BigMAC Primary Regs");
1171 if (!bp->bregs) { 1152 if (!bp->bregs) {
1172 printk(KERN_ERR "BIGMAC: Cannot map BigMAC primary registers.\n"); 1153 printk(KERN_ERR "BIGMAC: Cannot map BigMAC primary registers.\n");
1173 goto fail_and_cleanup; 1154 goto fail_and_cleanup;
@@ -1176,8 +1157,8 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1176 /* Map in the BigMAC transceiver registers, this is how you poke at 1157 /* Map in the BigMAC transceiver registers, this is how you poke at
1177 * the BigMAC's PHY. 1158 * the BigMAC's PHY.
1178 */ 1159 */
1179 bp->tregs = sbus_ioremap(&bp->bigmac_sdev->resource[2], 0, 1160 bp->tregs = of_ioremap(&op->resource[2], 0,
1180 TCVR_REG_SIZE, "BigMAC Transceiver Regs"); 1161 TCVR_REG_SIZE, "BigMAC Transceiver Regs");
1181 if (!bp->tregs) { 1162 if (!bp->tregs) {
1182 printk(KERN_ERR "BIGMAC: Cannot map BigMAC transceiver registers.\n"); 1163 printk(KERN_ERR "BIGMAC: Cannot map BigMAC transceiver registers.\n");
1183 goto fail_and_cleanup; 1164 goto fail_and_cleanup;
@@ -1187,7 +1168,7 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1187 bigmac_stop(bp); 1168 bigmac_stop(bp);
1188 1169
1189 /* Allocate transmit/receive descriptor DVMA block. */ 1170 /* Allocate transmit/receive descriptor DVMA block. */
1190 bp->bmac_block = dma_alloc_coherent(&bp->bigmac_sdev->ofdev.dev, 1171 bp->bmac_block = dma_alloc_coherent(&bp->bigmac_op->dev,
1191 PAGE_SIZE, 1172 PAGE_SIZE,
1192 &bp->bblock_dvma, GFP_ATOMIC); 1173 &bp->bblock_dvma, GFP_ATOMIC);
1193 if (bp->bmac_block == NULL || bp->bblock_dvma == 0) { 1174 if (bp->bmac_block == NULL || bp->bblock_dvma == 0) {
@@ -1196,8 +1177,8 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1196 } 1177 }
1197 1178
1198 /* Get the board revision of this BigMAC. */ 1179 /* Get the board revision of this BigMAC. */
1199 bp->board_rev = prom_getintdefault(bp->bigmac_sdev->prom_node, 1180 bp->board_rev = of_getintprop_default(bp->bigmac_op->node,
1200 "board-version", 1); 1181 "board-version", 1);
1201 1182
1202 /* Init auto-negotiation timer state. */ 1183 /* Init auto-negotiation timer state. */
1203 init_timer(&bp->bigmac_timer); 1184 init_timer(&bp->bigmac_timer);
@@ -1221,7 +1202,7 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1221 dev->watchdog_timeo = 5*HZ; 1202 dev->watchdog_timeo = 5*HZ;
1222 1203
1223 /* Finish net device registration. */ 1204 /* Finish net device registration. */
1224 dev->irq = bp->bigmac_sdev->irqs[0]; 1205 dev->irq = bp->bigmac_op->irqs[0];
1225 dev->dma = 0; 1206 dev->dma = 0;
1226 1207
1227 if (register_netdev(dev)) { 1208 if (register_netdev(dev)) {
@@ -1229,7 +1210,7 @@ static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
1229 goto fail_and_cleanup; 1210 goto fail_and_cleanup;
1230 } 1211 }
1231 1212
1232 dev_set_drvdata(&bp->bigmac_sdev->ofdev.dev, bp); 1213 dev_set_drvdata(&bp->bigmac_op->dev, bp);
1233 1214
1234 printk(KERN_INFO "%s: BigMAC 100baseT Ethernet %s\n", 1215 printk(KERN_INFO "%s: BigMAC 100baseT Ethernet %s\n",
1235 dev->name, print_mac(mac, dev->dev_addr)); 1216 dev->name, print_mac(mac, dev->dev_addr));
@@ -1240,16 +1221,16 @@ fail_and_cleanup:
1240 /* Something went wrong, undo whatever we did so far. */ 1221 /* Something went wrong, undo whatever we did so far. */
1241 /* Free register mappings if any. */ 1222 /* Free register mappings if any. */
1242 if (bp->gregs) 1223 if (bp->gregs)
1243 sbus_iounmap(bp->gregs, GLOB_REG_SIZE); 1224 of_iounmap(&qec_op->resource[0], bp->gregs, GLOB_REG_SIZE);
1244 if (bp->creg) 1225 if (bp->creg)
1245 sbus_iounmap(bp->creg, CREG_REG_SIZE); 1226 of_iounmap(&op->resource[0], bp->creg, CREG_REG_SIZE);
1246 if (bp->bregs) 1227 if (bp->bregs)
1247 sbus_iounmap(bp->bregs, BMAC_REG_SIZE); 1228 of_iounmap(&op->resource[1], bp->bregs, BMAC_REG_SIZE);
1248 if (bp->tregs) 1229 if (bp->tregs)
1249 sbus_iounmap(bp->tregs, TCVR_REG_SIZE); 1230 of_iounmap(&op->resource[2], bp->tregs, TCVR_REG_SIZE);
1250 1231
1251 if (bp->bmac_block) 1232 if (bp->bmac_block)
1252 dma_free_coherent(&bp->bigmac_sdev->ofdev.dev, 1233 dma_free_coherent(&bp->bigmac_op->dev,
1253 PAGE_SIZE, 1234 PAGE_SIZE,
1254 bp->bmac_block, 1235 bp->bmac_block,
1255 bp->bblock_dvma); 1236 bp->bblock_dvma);
@@ -1259,48 +1240,49 @@ fail_and_cleanup:
1259 return -ENODEV; 1240 return -ENODEV;
1260} 1241}
1261 1242
1262/* QEC can be the parent of either QuadEthernet or 1243/* QEC can be the parent of either QuadEthernet or a BigMAC. We want
1263 * a BigMAC. We want the latter. 1244 * the latter.
1264 */ 1245 */
1265static int __devinit bigmac_sbus_probe(struct of_device *dev, const struct of_device_id *match) 1246static int __devinit bigmac_sbus_probe(struct of_device *op,
1247 const struct of_device_id *match)
1266{ 1248{
1267 struct sbus_dev *sdev = to_sbus_device(&dev->dev); 1249 struct device *parent = op->dev.parent;
1268 struct device_node *dp = dev->node; 1250 struct of_device *qec_op;
1269 1251
1270 if (!strcmp(dp->name, "be")) 1252 qec_op = to_of_device(parent);
1271 sdev = sdev->parent;
1272 1253
1273 return bigmac_ether_init(sdev); 1254 return bigmac_ether_init(op, qec_op);
1274} 1255}
1275 1256
1276static int __devexit bigmac_sbus_remove(struct of_device *dev) 1257static int __devexit bigmac_sbus_remove(struct of_device *op)
1277{ 1258{
1278 struct bigmac *bp = dev_get_drvdata(&dev->dev); 1259 struct bigmac *bp = dev_get_drvdata(&op->dev);
1260 struct device *parent = op->dev.parent;
1279 struct net_device *net_dev = bp->dev; 1261 struct net_device *net_dev = bp->dev;
1262 struct of_device *qec_op;
1263
1264 qec_op = to_of_device(parent);
1280 1265
1281 unregister_netdevice(net_dev); 1266 unregister_netdevice(net_dev);
1282 1267
1283 sbus_iounmap(bp->gregs, GLOB_REG_SIZE); 1268 of_iounmap(&qec_op->resource[0], bp->gregs, GLOB_REG_SIZE);
1284 sbus_iounmap(bp->creg, CREG_REG_SIZE); 1269 of_iounmap(&op->resource[0], bp->creg, CREG_REG_SIZE);
1285 sbus_iounmap(bp->bregs, BMAC_REG_SIZE); 1270 of_iounmap(&op->resource[1], bp->bregs, BMAC_REG_SIZE);
1286 sbus_iounmap(bp->tregs, TCVR_REG_SIZE); 1271 of_iounmap(&op->resource[2], bp->tregs, TCVR_REG_SIZE);
1287 dma_free_coherent(&bp->bigmac_sdev->ofdev.dev, 1272 dma_free_coherent(&op->dev,
1288 PAGE_SIZE, 1273 PAGE_SIZE,
1289 bp->bmac_block, 1274 bp->bmac_block,
1290 bp->bblock_dvma); 1275 bp->bblock_dvma);
1291 1276
1292 free_netdev(net_dev); 1277 free_netdev(net_dev);
1293 1278
1294 dev_set_drvdata(&dev->dev, NULL); 1279 dev_set_drvdata(&op->dev, NULL);
1295 1280
1296 return 0; 1281 return 0;
1297} 1282}
1298 1283
1299static struct of_device_id bigmac_sbus_match[] = { 1284static struct of_device_id bigmac_sbus_match[] = {
1300 { 1285 {
1301 .name = "qec",
1302 },
1303 {
1304 .name = "be", 1286 .name = "be",
1305 }, 1287 },
1306 {}, 1288 {},
@@ -1317,7 +1299,7 @@ static struct of_platform_driver bigmac_sbus_driver = {
1317 1299
1318static int __init bigmac_init(void) 1300static int __init bigmac_init(void)
1319{ 1301{
1320 return of_register_driver(&bigmac_sbus_driver, &sbus_bus_type); 1302 return of_register_driver(&bigmac_sbus_driver, &of_bus_type);
1321} 1303}
1322 1304
1323static void __exit bigmac_exit(void) 1305static void __exit bigmac_exit(void)
diff --git a/drivers/net/sunbmac.h b/drivers/net/sunbmac.h
index b563d3c2993e..8840bc0b840b 100644
--- a/drivers/net/sunbmac.h
+++ b/drivers/net/sunbmac.h
@@ -329,8 +329,8 @@ struct bigmac {
329 unsigned int timer_ticks; 329 unsigned int timer_ticks;
330 330
331 struct net_device_stats enet_stats; 331 struct net_device_stats enet_stats;
332 struct sbus_dev *qec_sdev; 332 struct of_device *qec_op;
333 struct sbus_dev *bigmac_sdev; 333 struct of_device *bigmac_op;
334 struct net_device *dev; 334 struct net_device *dev;
335}; 335};
336 336