-Index: linux-2.6.23/drivers/net/b44.c
+Index: linux-2.6.23.16/drivers/net/b44.c
===================================================================
---- linux-2.6.23.orig/drivers/net/b44.c 2007-10-09 22:31:38.000000000 +0200
-+++ linux-2.6.23/drivers/net/b44.c 2007-10-13 02:46:38.946989430 +0200
+--- linux-2.6.23.16.orig/drivers/net/b44.c 2008-02-19 01:35:58.000000000 +0100
++++ linux-2.6.23.16/drivers/net/b44.c 2008-02-19 01:37:04.000000000 +0100
@@ -1,7 +1,9 @@
-/* b44.c: Broadcom 4400 device driver.
+/* b44.c: Broadcom 4400/47xx device driver.
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_MODULE_VERSION);
-@@ -96,18 +100,11 @@
+@@ -96,18 +100,11 @@ static int b44_debug = -1; /* -1 == use
module_param(b44_debug, int, 0);
MODULE_PARM_DESC(b44_debug, "B44 bitmapped debugging message enable value");
static void b44_halt(struct b44 *);
static void b44_init_rings(struct b44 *);
-@@ -119,6 +116,7 @@
+@@ -119,6 +116,7 @@ static void b44_init_hw(struct b44 *, in
static int dma_desc_align_mask;
static int dma_desc_sync_size;
static const char b44_gstrings[][ETH_GSTRING_LEN] = {
#define _B44(x...) # x,
-@@ -126,35 +124,24 @@
+@@ -126,35 +124,24 @@ B44_STAT_REG_DECLARE
#undef _B44
};
+ unsigned long offset,
+ enum dma_data_direction dir)
+{
-+ dma_sync_single_range_for_device(&sdev->dev, dma_base,
++ dma_sync_single_range_for_device(sdev->dev, dma_base,
+ offset & dma_desc_align_mask,
+ dma_desc_sync_size, dir);
+}
+ unsigned long offset,
+ enum dma_data_direction dir)
+{
-+ dma_sync_single_range_for_cpu(&sdev->dev, dma_base,
++ dma_sync_single_range_for_cpu(sdev->dev, dma_base,
+ offset & dma_desc_align_mask,
+ dma_desc_sync_size, dir);
}
static int b44_wait_bit(struct b44 *bp, unsigned long reg,
-@@ -182,117 +169,29 @@
+@@ -182,117 +169,29 @@ static int b44_wait_bit(struct b44 *bp,
return 0;
}
{
u32 val;
-@@ -328,14 +227,14 @@
+@@ -328,14 +227,14 @@ static void b44_enable_ints(struct b44 *
bw32(bp, B44_IMASK, bp->imask);
}
(reg << MDIO_DATA_RA_SHIFT) |
(MDIO_TA_VALID << MDIO_DATA_TA_SHIFT)));
err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
-@@ -344,18 +243,34 @@
+@@ -344,18 +243,34 @@ static int b44_readphy(struct b44 *bp, i
return err;
}
/* miilib interface */
/* FIXME FIXME: phy_id is ignored, bp->phy_addr use is unconditional
* due to code existing before miilib use was added to this driver.
-@@ -384,6 +299,8 @@
+@@ -384,6 +299,8 @@ static int b44_phy_reset(struct b44 *bp)
u32 val;
int err;
err = b44_writephy(bp, MII_BMCR, BMCR_RESET);
if (err)
return err;
-@@ -442,11 +359,27 @@
+@@ -442,11 +359,27 @@ static void b44_set_flow_ctrl(struct b44
__b44_set_flow_ctrl(bp, pause_enab);
}
if ((err = b44_readphy(bp, B44_MII_ALEDCTRL, &val)) != 0)
goto out;
if ((err = b44_writephy(bp, B44_MII_ALEDCTRL,
-@@ -542,6 +475,19 @@
+@@ -542,6 +475,19 @@ static void b44_check_phy(struct b44 *bp
{
u32 bmsr, aux;
if (!b44_readphy(bp, MII_BMSR, &bmsr) &&
!b44_readphy(bp, B44_MII_AUXCTRL, &aux) &&
(bmsr != 0xffff)) {
-@@ -617,10 +563,10 @@
+@@ -617,10 +563,10 @@ static void b44_tx(struct b44 *bp)
BUG_ON(skb == NULL);
- pci_unmap_single(bp->pdev,
-+ dma_unmap_single(&bp->sdev->dev,
++ dma_unmap_single(bp->sdev->dev,
pci_unmap_addr(rp, mapping),
skb->len,
- PCI_DMA_TODEVICE);
rp->skb = NULL;
dev_kfree_skb_irq(skb);
}
-@@ -657,9 +603,9 @@
+@@ -657,9 +603,9 @@ static int b44_alloc_rx_skb(struct b44 *
if (skb == NULL)
return -ENOMEM;
- mapping = pci_map_single(bp->pdev, skb->data,
-+ mapping = dma_map_single(&bp->sdev->dev, skb->data,
++ mapping = dma_map_single(bp->sdev->dev, skb->data,
RX_PKT_BUF_SZ,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
/* Hardware bug work-around, the chip is unable to do PCI DMA
to/from anything above 1GB :-( */
-@@ -667,18 +613,18 @@
+@@ -667,18 +613,18 @@ static int b44_alloc_rx_skb(struct b44 *
mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
/* Sigh... */
if (!dma_mapping_error(mapping))
- pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
-+ dma_unmap_single(&bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
++ dma_unmap_single(bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
dev_kfree_skb_any(skb);
skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA);
if (skb == NULL)
return -ENOMEM;
- mapping = pci_map_single(bp->pdev, skb->data,
-+ mapping = dma_map_single(&bp->sdev->dev, skb->data,
++ mapping = dma_map_single(bp->sdev->dev, skb->data,
RX_PKT_BUF_SZ,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
mapping + RX_PKT_BUF_SZ > DMA_30BIT_MASK) {
if (!dma_mapping_error(mapping))
- pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
-+ dma_unmap_single(&bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
++ dma_unmap_single(bp->sdev->dev, mapping, RX_PKT_BUF_SZ,DMA_FROM_DEVICE);
dev_kfree_skb_any(skb);
return -ENOMEM;
}
-@@ -705,9 +651,9 @@
+@@ -705,9 +651,9 @@ static int b44_alloc_rx_skb(struct b44 *
dp->addr = cpu_to_le32((u32) mapping + RX_PKT_OFFSET + bp->dma_offset);
if (bp->flags & B44_FLAG_RX_RING_HACK)
return RX_PKT_BUF_SZ;
}
-@@ -734,9 +680,9 @@
+@@ -734,9 +680,9 @@ static void b44_recycle_rx(struct b44 *b
pci_unmap_addr(src_map, mapping));
if (bp->flags & B44_FLAG_RX_RING_HACK)
ctrl = src_desc->ctrl;
if (dest_idx == (B44_RX_RING_SIZE - 1))
-@@ -750,13 +696,13 @@
+@@ -750,13 +696,13 @@ static void b44_recycle_rx(struct b44 *b
src_map->skb = NULL;
if (bp->flags & B44_FLAG_RX_RING_HACK)
+ DMA_BIDIRECTIONAL);
- pci_dma_sync_single_for_device(bp->pdev, le32_to_cpu(src_desc->addr),
-+ dma_sync_single_for_device(&bp->sdev->dev, le32_to_cpu(src_desc->addr),
++ dma_sync_single_for_device(bp->sdev->dev, le32_to_cpu(src_desc->addr),
RX_PKT_BUF_SZ,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
}
static int b44_rx(struct b44 *bp, int budget)
-@@ -776,9 +722,9 @@
+@@ -776,9 +722,9 @@ static int b44_rx(struct b44 *bp, int bu
struct rx_header *rh;
u16 len;
- pci_dma_sync_single_for_cpu(bp->pdev, map,
-+ dma_sync_single_for_cpu(&bp->sdev->dev, map,
++ dma_sync_single_for_cpu(bp->sdev->dev, map,
RX_PKT_BUF_SZ,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
rh = (struct rx_header *) skb->data;
len = le16_to_cpu(rh->len);
if ((len > (RX_PKT_BUF_SZ - RX_PKT_OFFSET)) ||
-@@ -810,8 +756,8 @@
+@@ -810,8 +756,8 @@ static int b44_rx(struct b44 *bp, int bu
skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod);
if (skb_size < 0)
goto drop_it;
- pci_unmap_single(bp->pdev, map,
- skb_size, PCI_DMA_FROMDEVICE);
-+ dma_unmap_single(&bp->sdev->dev, map,
++ dma_unmap_single(bp->sdev->dev, map,
+ skb_size, DMA_FROM_DEVICE);
/* Leave out rx_header */
skb_put(skb, len + RX_PKT_OFFSET);
skb_pull(skb, RX_PKT_OFFSET);
-@@ -982,24 +928,24 @@
+@@ -982,24 +928,24 @@ static int b44_start_xmit(struct sk_buff
goto err_out;
}
- mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
-+ mapping = dma_map_single(&bp->sdev->dev, skb->data, len, DMA_TO_DEVICE);
++ mapping = dma_map_single(bp->sdev->dev, skb->data, len, DMA_TO_DEVICE);
if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
struct sk_buff *bounce_skb;
/* Chip can't handle DMA to/from >1GB, use bounce buffer */
if (!dma_mapping_error(mapping))
- pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE);
-+ dma_unmap_single(&bp->sdev->dev, mapping, len, DMA_TO_DEVICE);
++ dma_unmap_single(bp->sdev->dev, mapping, len, DMA_TO_DEVICE);
bounce_skb = __dev_alloc_skb(len, GFP_ATOMIC | GFP_DMA);
if (!bounce_skb)
- mapping = pci_map_single(bp->pdev, bounce_skb->data,
- len, PCI_DMA_TODEVICE);
-+ mapping = dma_map_single(&bp->sdev->dev, bounce_skb->data,
++ mapping = dma_map_single(bp->sdev->dev, bounce_skb->data,
+ len, DMA_TO_DEVICE);
if (dma_mapping_error(mapping) || mapping + len > DMA_30BIT_MASK) {
if (!dma_mapping_error(mapping))
- pci_unmap_single(bp->pdev, mapping,
- len, PCI_DMA_TODEVICE);
-+ dma_unmap_single(&bp->sdev->dev, mapping,
++ dma_unmap_single(bp->sdev->dev, mapping,
+ len, DMA_TO_DEVICE);
dev_kfree_skb_any(bounce_skb);
goto err_out;
}
-@@ -1022,9 +968,9 @@
+@@ -1022,9 +968,9 @@ static int b44_start_xmit(struct sk_buff
bp->tx_ring[entry].addr = cpu_to_le32((u32) mapping+bp->dma_offset);
if (bp->flags & B44_FLAG_TX_RING_HACK)
entry = NEXT_TX(entry);
-@@ -1097,10 +1043,10 @@
+@@ -1097,10 +1043,10 @@ static void b44_free_rings(struct b44 *b
if (rp->skb == NULL)
continue;
- pci_unmap_single(bp->pdev,
-+ dma_unmap_single(&bp->sdev->dev,
++ dma_unmap_single(bp->sdev->dev,
pci_unmap_addr(rp, mapping),
RX_PKT_BUF_SZ,
- PCI_DMA_FROMDEVICE);
dev_kfree_skb_any(rp->skb);
rp->skb = NULL;
}
-@@ -1111,10 +1057,10 @@
+@@ -1111,10 +1057,10 @@ static void b44_free_rings(struct b44 *b
if (rp->skb == NULL)
continue;
- pci_unmap_single(bp->pdev,
-+ dma_unmap_single(&bp->sdev->dev,
++ dma_unmap_single(bp->sdev->dev,
pci_unmap_addr(rp, mapping),
rp->skb->len,
- PCI_DMA_TODEVICE);
dev_kfree_skb_any(rp->skb);
rp->skb = NULL;
}
-@@ -1136,14 +1082,14 @@
+@@ -1136,14 +1082,14 @@ static void b44_init_rings(struct b44 *b
memset(bp->tx_ring, 0, B44_TX_RING_BYTES);
if (bp->flags & B44_FLAG_RX_RING_HACK)
- dma_sync_single_for_device(&bp->pdev->dev, bp->rx_ring_dma,
- DMA_TABLE_BYTES,
- PCI_DMA_BIDIRECTIONAL);
-+ dma_sync_single_for_device(&bp->sdev->dev, bp->rx_ring_dma,
++ dma_sync_single_for_device(bp->sdev->dev, bp->rx_ring_dma,
+ DMA_TABLE_BYTES,
+ DMA_BIDIRECTIONAL);
- dma_sync_single_for_device(&bp->pdev->dev, bp->tx_ring_dma,
- DMA_TABLE_BYTES,
- PCI_DMA_TODEVICE);
-+ dma_sync_single_for_device(&bp->sdev->dev, bp->tx_ring_dma,
++ dma_sync_single_for_device(bp->sdev->dev, bp->tx_ring_dma,
+ DMA_TABLE_BYTES,
+ DMA_TO_DEVICE);
for (i = 0; i < bp->rx_pending; i++) {
if (b44_alloc_rx_skb(bp, -1, i) < 0)
-@@ -1163,24 +1109,24 @@
+@@ -1163,24 +1109,24 @@ static void b44_free_consistent(struct b
bp->tx_buffers = NULL;
if (bp->rx_ring) {
if (bp->flags & B44_FLAG_RX_RING_HACK) {
- dma_unmap_single(&bp->pdev->dev, bp->rx_ring_dma,
- DMA_TABLE_BYTES,
- DMA_BIDIRECTIONAL);
-+ dma_unmap_single(&bp->sdev->dev, bp->rx_ring_dma,
++ dma_unmap_single(bp->sdev->dev, bp->rx_ring_dma,
+ DMA_TABLE_BYTES,
+ DMA_BIDIRECTIONAL);
kfree(bp->rx_ring);
} else
- pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
-+ dma_free_coherent(&bp->sdev->dev, DMA_TABLE_BYTES,
++ dma_free_coherent(bp->sdev->dev, DMA_TABLE_BYTES,
bp->rx_ring, bp->rx_ring_dma);
bp->rx_ring = NULL;
bp->flags &= ~B44_FLAG_RX_RING_HACK;
- dma_unmap_single(&bp->pdev->dev, bp->tx_ring_dma,
- DMA_TABLE_BYTES,
- DMA_TO_DEVICE);
-+ dma_unmap_single(&bp->sdev->dev, bp->tx_ring_dma,
++ dma_unmap_single(bp->sdev->dev, bp->tx_ring_dma,
+ DMA_TABLE_BYTES,
+ DMA_TO_DEVICE);
kfree(bp->tx_ring);
} else
- pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
-+ dma_free_coherent(&bp->sdev->dev, DMA_TABLE_BYTES,
++ dma_free_coherent(bp->sdev->dev, DMA_TABLE_BYTES,
bp->tx_ring, bp->tx_ring_dma);
bp->tx_ring = NULL;
bp->flags &= ~B44_FLAG_TX_RING_HACK;
-@@ -1206,7 +1152,7 @@
+@@ -1206,7 +1152,7 @@ static int b44_alloc_consistent(struct b
goto out_err;
size = DMA_TABLE_BYTES;
- bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma);
-+ bp->rx_ring = dma_alloc_coherent(&bp->sdev->dev, size, &bp->rx_ring_dma, GFP_ATOMIC);
++ bp->rx_ring = dma_alloc_coherent(bp->sdev->dev, size, &bp->rx_ring_dma, GFP_ATOMIC);
if (!bp->rx_ring) {
/* Allocation may have failed due to pci_alloc_consistent
insisting on use of GFP_DMA, which is more restrictive
-@@ -1218,9 +1164,9 @@
+@@ -1218,9 +1164,9 @@ static int b44_alloc_consistent(struct b
if (!rx_ring)
goto out_err;
- rx_ring_dma = dma_map_single(&bp->pdev->dev, rx_ring,
- DMA_TABLE_BYTES,
- DMA_BIDIRECTIONAL);
-+ rx_ring_dma = dma_map_single(&bp->sdev->dev, rx_ring,
++ rx_ring_dma = dma_map_single(bp->sdev->dev, rx_ring,
+ DMA_TABLE_BYTES,
+ DMA_BIDIRECTIONAL);
if (dma_mapping_error(rx_ring_dma) ||
rx_ring_dma + size > DMA_30BIT_MASK) {
-@@ -1233,9 +1179,9 @@
+@@ -1233,9 +1179,9 @@ static int b44_alloc_consistent(struct b
bp->flags |= B44_FLAG_RX_RING_HACK;
}
- bp->tx_ring = pci_alloc_consistent(bp->pdev, size, &bp->tx_ring_dma);
-+ bp->tx_ring = dma_alloc_coherent(&bp->sdev->dev, size, &bp->tx_ring_dma, GFP_ATOMIC);
++ bp->tx_ring = dma_alloc_coherent(bp->sdev->dev, size, &bp->tx_ring_dma, GFP_ATOMIC);
if (!bp->tx_ring) {
- /* Allocation may have failed due to pci_alloc_consistent
+ /* Allocation may have failed due to dma_alloc_coherent
insisting on use of GFP_DMA, which is more restrictive
than necessary... */
struct dma_desc *tx_ring;
-@@ -1245,9 +1191,9 @@
+@@ -1245,9 +1191,9 @@ static int b44_alloc_consistent(struct b
if (!tx_ring)
goto out_err;
- tx_ring_dma = dma_map_single(&bp->pdev->dev, tx_ring,
- DMA_TABLE_BYTES,
- DMA_TO_DEVICE);
-+ tx_ring_dma = dma_map_single(&bp->sdev->dev, tx_ring,
++ tx_ring_dma = dma_map_single(bp->sdev->dev, tx_ring,
+ DMA_TABLE_BYTES,
+ DMA_TO_DEVICE);
if (dma_mapping_error(tx_ring_dma) ||
tx_ring_dma + size > DMA_30BIT_MASK) {
-@@ -1282,7 +1228,9 @@
+@@ -1282,7 +1228,9 @@ static void b44_clear_stats(struct b44 *
/* bp->lock is held. */
static void b44_chip_reset(struct b44 *bp)
{
bw32(bp, B44_RCV_LAZY, 0);
bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE);
b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 200, 1);
-@@ -1294,19 +1242,23 @@
+@@ -1294,19 +1242,24 @@ static void b44_chip_reset(struct b44 *b
}
bw32(bp, B44_DMARX_CTRL, 0);
bp->rx_prod = bp->rx_cons = 0;
+ & MDIO_CTRL_MAXF_MASK)));
+ break;
+ case SSB_BUSTYPE_PCI:
++ case SSB_BUSTYPE_PCMCIA:
+ bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
(0x0d & MDIO_CTRL_MAXF_MASK)));
+ break;
br32(bp, B44_MDIO_CTRL);
if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) {
-@@ -1349,6 +1301,7 @@
+@@ -1349,6 +1302,7 @@ static int b44_set_mac_addr(struct net_d
{
struct b44 *bp = netdev_priv(dev);
struct sockaddr *addr = p;
if (netif_running(dev))
return -EBUSY;
-@@ -1359,7 +1312,11 @@
+@@ -1359,7 +1313,11 @@ static int b44_set_mac_addr(struct net_d
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
spin_lock_irq(&bp->lock);
spin_unlock_irq(&bp->lock);
return 0;
-@@ -1445,18 +1402,6 @@
+@@ -1445,18 +1403,6 @@ out:
return err;
}
#ifdef CONFIG_NET_POLL_CONTROLLER
/*
* Polling receive - used by netconsole and other diagnostic tools
-@@ -1570,7 +1515,6 @@
+@@ -1570,7 +1516,6 @@ static void b44_setup_pseudo_magicp(stru
static void b44_setup_wol(struct b44 *bp)
{
u32 val;
bw32(bp, B44_RXCONFIG, RXCONFIG_ALLMULTI);
-@@ -1594,13 +1538,6 @@
+@@ -1594,13 +1539,6 @@ static void b44_setup_wol(struct b44 *bp
} else {
b44_setup_pseudo_magicp(bp);
}
}
static int b44_close(struct net_device *dev)
-@@ -1700,7 +1637,7 @@
+@@ -1700,7 +1638,7 @@ static void __b44_set_rx_mode(struct net
val = br32(bp, B44_RXCONFIG);
val &= ~(RXCONFIG_PROMISC | RXCONFIG_ALLMULTI);
val |= RXCONFIG_PROMISC;
bw32(bp, B44_RXCONFIG, val);
} else {
-@@ -1747,12 +1684,8 @@
+@@ -1747,12 +1685,8 @@ static void b44_set_msglevel(struct net_
static void b44_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
{
}
static int b44_nway_reset(struct net_device *dev)
-@@ -2035,6 +1968,245 @@
+@@ -2035,6 +1969,245 @@ static const struct ethtool_ops b44_etht
.get_ethtool_stats = b44_get_ethtool_stats,
};
static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct mii_ioctl_data *data = if_mii(ifr);
-@@ -2044,40 +2216,64 @@
+@@ -2044,40 +2217,64 @@ static int b44_ioctl(struct net_device *
if (!netif_running(dev))
goto out;
- bp->dev->dev_addr[5] = eeprom[82];
+ switch (instance) {
+ case 1:
-+ addr = sdev->bus->sprom.r1.et0mac;
-+ bp->phy_addr = sdev->bus->sprom.r1.et0phyaddr;
++ addr = sdev->bus->sprom.et0mac;
++ bp->phy_addr = sdev->bus->sprom.et0phyaddr;
+ break;
+ default:
-+ addr = sdev->bus->sprom.r1.et1mac;
-+ bp->phy_addr = sdev->bus->sprom.r1.et1phyaddr;
++ addr = sdev->bus->sprom.et1mac;
++ bp->phy_addr = sdev->bus->sprom.et1phyaddr;
+ break;
+ }
+
if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
printk(KERN_ERR PFX "Invalid MAC address found in EEPROM\n");
-@@ -2086,26 +2282,20 @@
+@@ -2086,103 +2283,52 @@ static int __devinit b44_get_invariants(
memcpy(bp->dev->perm_addr, bp->dev->dev_addr, bp->dev->addr_len);
*/
- if (ssb_get_core_rev(bp) >= 7)
-+ if (bp->sdev->dev->id.revision >= 7)
++ if (bp->sdev->id.revision >= 7)
bp->flags |= B44_FLAG_B0_ANDLATER;
-out:
+ const struct ssb_device_id *ent)
{
static int b44_version_printed = 0;
- unsigned long b44reg_base, b44reg_len;
-@@ -2113,76 +2303,32 @@
+- unsigned long b44reg_base, b44reg_len;
+ struct net_device *dev;
struct b44 *bp;
int err, i;
-
dev = alloc_etherdev(sizeof(*bp));
if (!dev) {
- dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n");
+- dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n");
++ dev_err(sdev->dev, "Etherdev alloc failed, aborting.\n");
err = -ENOMEM;
- goto err_out_free_res;
+ goto out;
SET_MODULE_OWNER(dev);
- SET_NETDEV_DEV(dev,&pdev->dev);
-+ SET_NETDEV_DEV(dev,&sdev->dev);
++ SET_NETDEV_DEV(dev,sdev->dev);
/* No interesting netdevice features in this card... */
dev->features |= 0;
bp->rx_pending = B44_DEF_RX_RING_PENDING;
bp->tx_pending = B44_DEF_TX_RING_PENDING;
-@@ -2201,16 +2347,16 @@
+@@ -2201,16 +2347,16 @@ static int __devinit b44_init_one(struct
dev->poll_controller = b44_poll_controller;
#endif
dev->change_mtu = b44_change_mtu;
err = b44_get_invariants(bp);
if (err) {
- dev_err(&pdev->dev,
-+ dev_err(&sdev->dev,
++ dev_err(sdev->dev,
"Problem fetching invariants of chip, aborting.\n");
- goto err_out_iounmap;
+ goto err_out_free_dev;
}
bp->mii_if.dev = dev;
-@@ -2229,61 +2375,52 @@
+@@ -2229,61 +2375,52 @@ static int __devinit b44_init_one(struct
err = register_netdev(dev);
if (err) {
- dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
- goto err_out_iounmap;
-+ dev_err(&sdev->dev, "Cannot register net device, aborting.\n");
++ dev_err(sdev->dev, "Cannot register net device, aborting.\n");
+ goto out;
}
del_timer_sync(&bp->timer);
-@@ -2301,26 +2438,16 @@
+@@ -2301,33 +2438,22 @@ static int b44_suspend(struct pci_dev *p
b44_init_hw(bp, B44_PARTIAL_RESET);
b44_setup_wol(bp);
}
if (!netif_running(dev))
return 0;
-@@ -2346,29 +2473,31 @@
+ rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev);
+ if (rc) {
+ printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name);
+- pci_disable_device(pdev);
+ return rc;
+ }
+
+@@ -2346,29 +2472,31 @@ static int b44_resume(struct pci_dev *pd
return 0;
}
}
module_init(b44_init);
-Index: linux-2.6.23/drivers/net/b44.h
+Index: linux-2.6.23.16/drivers/net/b44.h
===================================================================
---- linux-2.6.23.orig/drivers/net/b44.h 2007-10-09 22:31:38.000000000 +0200
-+++ linux-2.6.23/drivers/net/b44.h 2007-10-13 02:28:25.848697310 +0200
+--- linux-2.6.23.16.orig/drivers/net/b44.h 2008-02-19 01:35:58.000000000 +0100
++++ linux-2.6.23.16/drivers/net/b44.h 2008-02-19 01:36:00.000000000 +0100
@@ -129,6 +129,7 @@
#define RXCONFIG_FLOW 0x00000020 /* Flow Control Enable */
#define RXCONFIG_FLOW_ACCEPT 0x00000040 /* Accept Unicast Flow Control Frame */
/* 4400 PHY registers */
#define B44_MII_AUXCTRL 24 /* Auxiliary Control */
-@@ -346,10 +281,12 @@
+@@ -346,10 +281,12 @@ struct rx_header {
struct ring_info {
struct sk_buff *skb;
#define B44_STAT_REG_DECLARE \
_B44(tx_good_octets) \
-@@ -425,9 +362,10 @@
+@@ -425,9 +362,10 @@ struct b44 {
u32 dma_offset;
u32 flags;
#define B44_FLAG_PAUSE_AUTO 0x00008000
#define B44_FLAG_FULL_DUPLEX 0x00010000
#define B44_FLAG_100_BASE_T 0x00020000
-@@ -450,8 +388,7 @@
+@@ -450,8 +388,7 @@ struct b44 {
struct net_device_stats stats;
struct b44_hw_stats hw_stats;
struct net_device *dev;
dma_addr_t rx_ring_dma, tx_ring_dma;
-Index: linux-2.6.23/drivers/net/Kconfig
+Index: linux-2.6.23.16/drivers/net/Kconfig
===================================================================
---- linux-2.6.23.orig/drivers/net/Kconfig 2007-10-13 02:19:47.919182188 +0200
-+++ linux-2.6.23/drivers/net/Kconfig 2007-10-13 02:28:25.860697993 +0200
-@@ -1577,7 +1577,7 @@
+--- linux-2.6.23.16.orig/drivers/net/Kconfig 2008-02-19 01:35:58.000000000 +0100
++++ linux-2.6.23.16/drivers/net/Kconfig 2008-02-19 01:36:00.000000000 +0100
+@@ -1577,7 +1577,7 @@ config APRICOT
config B44
tristate "Broadcom 4400 ethernet support"