aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/b44.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2007-09-19 17:20:30 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:43 -0400
commit753f492093da7a40141bfe083073400f518f4c68 (patch)
tree32ccd2ed369527ee5acb82dbd49d1081b33480ae /drivers/net/b44.h
parenteff1a59c48e3c6a006eb4fe5f2e405a996f2259d (diff)
[B44]: port to native ssb support
Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/b44.h')
-rw-r--r--drivers/net/b44.h81
1 files changed, 7 insertions, 74 deletions
diff --git a/drivers/net/b44.h b/drivers/net/b44.h
index 63c55a4ab3cd..7db0c84a7950 100644
--- a/drivers/net/b44.h
+++ b/drivers/net/b44.h
@@ -129,6 +129,7 @@
129#define RXCONFIG_FLOW 0x00000020 /* Flow Control Enable */ 129#define RXCONFIG_FLOW 0x00000020 /* Flow Control Enable */
130#define RXCONFIG_FLOW_ACCEPT 0x00000040 /* Accept Unicast Flow Control Frame */ 130#define RXCONFIG_FLOW_ACCEPT 0x00000040 /* Accept Unicast Flow Control Frame */
131#define RXCONFIG_RFILT 0x00000080 /* Reject Filter */ 131#define RXCONFIG_RFILT 0x00000080 /* Reject Filter */
132#define RXCONFIG_CAM_ABSENT 0x00000100 /* CAM Absent */
132#define B44_RXMAXLEN 0x0404UL /* EMAC RX Max Packet Length */ 133#define B44_RXMAXLEN 0x0404UL /* EMAC RX Max Packet Length */
133#define B44_TXMAXLEN 0x0408UL /* EMAC TX Max Packet Length */ 134#define B44_TXMAXLEN 0x0408UL /* EMAC TX Max Packet Length */
134#define B44_MDIO_CTRL 0x0410UL /* EMAC MDIO Control */ 135#define B44_MDIO_CTRL 0x0410UL /* EMAC MDIO Control */
@@ -227,76 +228,6 @@
227#define B44_RX_PAUSE 0x05D4UL /* MIB RX Pause Packets */ 228#define B44_RX_PAUSE 0x05D4UL /* MIB RX Pause Packets */
228#define B44_RX_NPAUSE 0x05D8UL /* MIB RX Non-Pause Packets */ 229#define B44_RX_NPAUSE 0x05D8UL /* MIB RX Non-Pause Packets */
229 230
230/* Silicon backplane register definitions */
231#define B44_SBIMSTATE 0x0F90UL /* SB Initiator Agent State */
232#define SBIMSTATE_PC 0x0000000f /* Pipe Count */
233#define SBIMSTATE_AP_MASK 0x00000030 /* Arbitration Priority */
234#define SBIMSTATE_AP_BOTH 0x00000000 /* Use both timeslices and token */
235#define SBIMSTATE_AP_TS 0x00000010 /* Use timeslices only */
236#define SBIMSTATE_AP_TK 0x00000020 /* Use token only */
237#define SBIMSTATE_AP_RSV 0x00000030 /* Reserved */
238#define SBIMSTATE_IBE 0x00020000 /* In Band Error */
239#define SBIMSTATE_TO 0x00040000 /* Timeout */
240#define B44_SBINTVEC 0x0F94UL /* SB Interrupt Mask */
241#define SBINTVEC_PCI 0x00000001 /* Enable interrupts for PCI */
242#define SBINTVEC_ENET0 0x00000002 /* Enable interrupts for enet 0 */
243#define SBINTVEC_ILINE20 0x00000004 /* Enable interrupts for iline20 */
244#define SBINTVEC_CODEC 0x00000008 /* Enable interrupts for v90 codec */
245#define SBINTVEC_USB 0x00000010 /* Enable interrupts for usb */
246#define SBINTVEC_EXTIF 0x00000020 /* Enable interrupts for external i/f */
247#define SBINTVEC_ENET1 0x00000040 /* Enable interrupts for enet 1 */
248#define B44_SBTMSLOW 0x0F98UL /* SB Target State Low */
249#define SBTMSLOW_RESET 0x00000001 /* Reset */
250#define SBTMSLOW_REJECT 0x00000002 /* Reject */
251#define SBTMSLOW_CLOCK 0x00010000 /* Clock Enable */
252#define SBTMSLOW_FGC 0x00020000 /* Force Gated Clocks On */
253#define SBTMSLOW_PE 0x40000000 /* Power Management Enable */
254#define SBTMSLOW_BE 0x80000000 /* BIST Enable */
255#define B44_SBTMSHIGH 0x0F9CUL /* SB Target State High */
256#define SBTMSHIGH_SERR 0x00000001 /* S-error */
257#define SBTMSHIGH_INT 0x00000002 /* Interrupt */
258#define SBTMSHIGH_BUSY 0x00000004 /* Busy */
259#define SBTMSHIGH_GCR 0x20000000 /* Gated Clock Request */
260#define SBTMSHIGH_BISTF 0x40000000 /* BIST Failed */
261#define SBTMSHIGH_BISTD 0x80000000 /* BIST Done */
262#define B44_SBIDHIGH 0x0FFCUL /* SB Identification High */
263#define SBIDHIGH_RC_MASK 0x0000000f /* Revision Code */
264#define SBIDHIGH_CC_MASK 0x0000fff0 /* Core Code */
265#define SBIDHIGH_CC_SHIFT 4
266#define SBIDHIGH_VC_MASK 0xffff0000 /* Vendor Code */
267#define SBIDHIGH_VC_SHIFT 16
268
269/* SSB PCI config space registers. */
270#define SSB_PMCSR 0x44
271#define SSB_PE 0x100
272#define SSB_BAR0_WIN 0x80
273#define SSB_BAR1_WIN 0x84
274#define SSB_SPROM_CONTROL 0x88
275#define SSB_BAR1_CONTROL 0x8c
276
277/* SSB core and host control registers. */
278#define SSB_CONTROL 0x0000UL
279#define SSB_ARBCONTROL 0x0010UL
280#define SSB_ISTAT 0x0020UL
281#define SSB_IMASK 0x0024UL
282#define SSB_MBOX 0x0028UL
283#define SSB_BCAST_ADDR 0x0050UL
284#define SSB_BCAST_DATA 0x0054UL
285#define SSB_PCI_TRANS_0 0x0100UL
286#define SSB_PCI_TRANS_1 0x0104UL
287#define SSB_PCI_TRANS_2 0x0108UL
288#define SSB_SPROM 0x0800UL
289
290#define SSB_PCI_MEM 0x00000000
291#define SSB_PCI_IO 0x00000001
292#define SSB_PCI_CFG0 0x00000002
293#define SSB_PCI_CFG1 0x00000003
294#define SSB_PCI_PREF 0x00000004
295#define SSB_PCI_BURST 0x00000008
296#define SSB_PCI_MASK0 0xfc000000
297#define SSB_PCI_MASK1 0xfc000000
298#define SSB_PCI_MASK2 0xc0000000
299
300/* 4400 PHY registers */ 231/* 4400 PHY registers */
301#define B44_MII_AUXCTRL 24 /* Auxiliary Control */ 232#define B44_MII_AUXCTRL 24 /* Auxiliary Control */
302#define MII_AUXCTRL_DUPLEX 0x0001 /* Full Duplex */ 233#define MII_AUXCTRL_DUPLEX 0x0001 /* Full Duplex */
@@ -346,10 +277,12 @@ struct rx_header {
346 277
347struct ring_info { 278struct ring_info {
348 struct sk_buff *skb; 279 struct sk_buff *skb;
349 DECLARE_PCI_UNMAP_ADDR(mapping); 280 dma_addr_t mapping;
350}; 281};
351 282
352#define B44_MCAST_TABLE_SIZE 32 283#define B44_MCAST_TABLE_SIZE 32
284#define B44_PHY_ADDR_NO_PHY 30
285#define B44_MDC_RATIO 5000000
353 286
354#define B44_STAT_REG_DECLARE \ 287#define B44_STAT_REG_DECLARE \
355 _B44(tx_good_octets) \ 288 _B44(tx_good_octets) \
@@ -410,6 +343,8 @@ B44_STAT_REG_DECLARE
410#undef _B44 343#undef _B44
411}; 344};
412 345
346struct ssb_device;
347
413struct b44 { 348struct b44 {
414 spinlock_t lock; 349 spinlock_t lock;
415 350
@@ -452,8 +387,7 @@ struct b44 {
452 struct net_device_stats stats; 387 struct net_device_stats stats;
453 struct b44_hw_stats hw_stats; 388 struct b44_hw_stats hw_stats;
454 389
455 void __iomem *regs; 390 struct ssb_device *sdev;
456 struct pci_dev *pdev;
457 struct net_device *dev; 391 struct net_device *dev;
458 392
459 dma_addr_t rx_ring_dma, tx_ring_dma; 393 dma_addr_t rx_ring_dma, tx_ring_dma;
@@ -461,7 +395,6 @@ struct b44 {
461 u32 rx_pending; 395 u32 rx_pending;
462 u32 tx_pending; 396 u32 tx_pending;
463 u8 phy_addr; 397 u8 phy_addr;
464 u8 core_unit;
465 398
466 struct mii_if_info mii_if; 399 struct mii_if_info mii_if;
467}; 400};