aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/spider_net.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/spider_net.h')
-rw-r--r--drivers/net/spider_net.h34
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/net/spider_net.h b/drivers/net/spider_net.h
index 2fec5cf76926..4a1e0d28a502 100644
--- a/drivers/net/spider_net.h
+++ b/drivers/net/spider_net.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * Network device driver for Cell Processor-Based Blade 2 * Network device driver for Cell Processor-Based Blade and Celleb platform
3 * 3 *
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * (C) Copyright 2006 TOSHIBA CORPORATION
5 * 6 *
6 * Authors : Utz Bacher <utz.bacher@de.ibm.com> 7 * Authors : Utz Bacher <utz.bacher@de.ibm.com>
7 * Jens Osterkamp <Jens.Osterkamp@de.ibm.com> 8 * Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
@@ -24,7 +25,7 @@
24#ifndef _SPIDER_NET_H 25#ifndef _SPIDER_NET_H
25#define _SPIDER_NET_H 26#define _SPIDER_NET_H
26 27
27#define VERSION "1.6 B" 28#define VERSION "2.0 A"
28 29
29#include "sungem_phy.h" 30#include "sungem_phy.h"
30 31
@@ -50,6 +51,8 @@ extern char spider_net_driver_name[];
50#define SPIDER_NET_TX_DESCRIPTORS_MAX 512 51#define SPIDER_NET_TX_DESCRIPTORS_MAX 512
51 52
52#define SPIDER_NET_TX_TIMER (HZ/5) 53#define SPIDER_NET_TX_TIMER (HZ/5)
54#define SPIDER_NET_ANEG_TIMER (HZ)
55#define SPIDER_NET_ANEG_TIMEOUT 2
53 56
54#define SPIDER_NET_RX_CSUM_DEFAULT 1 57#define SPIDER_NET_RX_CSUM_DEFAULT 1
55 58
@@ -104,6 +107,7 @@ extern char spider_net_driver_name[];
104 107
105#define SPIDER_NET_GMACOPEMD 0x00000100 108#define SPIDER_NET_GMACOPEMD 0x00000100
106#define SPIDER_NET_GMACLENLMT 0x00000108 109#define SPIDER_NET_GMACLENLMT 0x00000108
110#define SPIDER_NET_GMACST 0x00000110
107#define SPIDER_NET_GMACINTEN 0x00000118 111#define SPIDER_NET_GMACINTEN 0x00000118
108#define SPIDER_NET_GMACPHYCTRL 0x00000120 112#define SPIDER_NET_GMACPHYCTRL 0x00000120
109 113
@@ -181,7 +185,8 @@ extern char spider_net_driver_name[];
181 185
182/* pause frames: automatic, no upper retransmission count */ 186/* pause frames: automatic, no upper retransmission count */
183/* outside loopback mode: ETOMOD signal dont matter, not connected */ 187/* outside loopback mode: ETOMOD signal dont matter, not connected */
184#define SPIDER_NET_OPMODE_VALUE 0x00000063 188/* ETOMOD signal is brought to PHY reset. bit 2 must be 1 in Celleb */
189#define SPIDER_NET_OPMODE_VALUE 0x00000067
185/*#define SPIDER_NET_OPMODE_VALUE 0x001b0062*/ 190/*#define SPIDER_NET_OPMODE_VALUE 0x001b0062*/
186#define SPIDER_NET_LENLMT_VALUE 0x00000908 191#define SPIDER_NET_LENLMT_VALUE 0x00000908
187 192
@@ -333,9 +338,12 @@ enum spider_net_int2_status {
333/* We rely on flagged descriptor interrupts */ 338/* We rely on flagged descriptor interrupts */
334#define SPIDER_NET_RXINT ( (1 << SPIDER_NET_GDAFDCINT) ) 339#define SPIDER_NET_RXINT ( (1 << SPIDER_NET_GDAFDCINT) )
335 340
341#define SPIDER_NET_LINKINT ( 1 << SPIDER_NET_GMAC2INT )
342
336#define SPIDER_NET_ERRINT ( 0xffffffff & \ 343#define SPIDER_NET_ERRINT ( 0xffffffff & \
337 (~SPIDER_NET_TXINT) & \ 344 (~SPIDER_NET_TXINT) & \
338 (~SPIDER_NET_RXINT) ) 345 (~SPIDER_NET_RXINT) & \
346 (~SPIDER_NET_LINKINT) )
339 347
340#define SPIDER_NET_GPREXEC 0x80000000 348#define SPIDER_NET_GPREXEC 0x80000000
341#define SPIDER_NET_GPRDAT_MASK 0x0000ffff 349#define SPIDER_NET_GPRDAT_MASK 0x0000ffff
@@ -356,8 +364,8 @@ enum spider_net_int2_status {
356#define SPIDER_NET_DESCR_NOT_IN_USE 0xF0000000 364#define SPIDER_NET_DESCR_NOT_IN_USE 0xF0000000
357#define SPIDER_NET_DESCR_TXDESFLG 0x00800000 365#define SPIDER_NET_DESCR_TXDESFLG 0x00800000
358 366
359struct spider_net_descr { 367/* Descriptor, as defined by the hardware */
360 /* as defined by the hardware */ 368struct spider_net_hw_descr {
361 u32 buf_addr; 369 u32 buf_addr;
362 u32 buf_size; 370 u32 buf_size;
363 u32 next_descr_addr; 371 u32 next_descr_addr;
@@ -366,13 +374,15 @@ struct spider_net_descr {
366 u32 valid_size; /* all zeroes for tx */ 374 u32 valid_size; /* all zeroes for tx */
367 u32 data_status; 375 u32 data_status;
368 u32 data_error; /* all zeroes for tx */ 376 u32 data_error; /* all zeroes for tx */
377} __attribute__((aligned(32)));
369 378
370 /* used in the driver */ 379struct spider_net_descr {
380 struct spider_net_hw_descr *hwdescr;
371 struct sk_buff *skb; 381 struct sk_buff *skb;
372 u32 bus_addr; 382 u32 bus_addr;
373 struct spider_net_descr *next; 383 struct spider_net_descr *next;
374 struct spider_net_descr *prev; 384 struct spider_net_descr *prev;
375} __attribute__((aligned(32))); 385};
376 386
377struct spider_net_descr_chain { 387struct spider_net_descr_chain {
378 spinlock_t lock; 388 spinlock_t lock;
@@ -380,6 +390,7 @@ struct spider_net_descr_chain {
380 struct spider_net_descr *tail; 390 struct spider_net_descr *tail;
381 struct spider_net_descr *ring; 391 struct spider_net_descr *ring;
382 int num_desc; 392 int num_desc;
393 struct spider_net_hw_descr *hwring;
383 dma_addr_t dma_addr; 394 dma_addr_t dma_addr;
384}; 395};
385 396
@@ -436,12 +447,16 @@ struct spider_net_card {
436 struct pci_dev *pdev; 447 struct pci_dev *pdev;
437 struct mii_phy phy; 448 struct mii_phy phy;
438 449
450 int medium;
451
439 void __iomem *regs; 452 void __iomem *regs;
440 453
441 struct spider_net_descr_chain tx_chain; 454 struct spider_net_descr_chain tx_chain;
442 struct spider_net_descr_chain rx_chain; 455 struct spider_net_descr_chain rx_chain;
443 struct spider_net_descr *low_watermark; 456 struct spider_net_descr *low_watermark;
444 457
458 int aneg_count;
459 struct timer_list aneg_timer;
445 struct timer_list tx_timer; 460 struct timer_list tx_timer;
446 struct work_struct tx_timeout_task; 461 struct work_struct tx_timeout_task;
447 atomic_t tx_timeout_task_counter; 462 atomic_t tx_timeout_task_counter;
@@ -452,6 +467,9 @@ struct spider_net_card {
452 struct net_device_stats netdev_stats; 467 struct net_device_stats netdev_stats;
453 struct spider_net_extra_stats spider_stats; 468 struct spider_net_extra_stats spider_stats;
454 struct spider_net_options options; 469 struct spider_net_options options;
470
471 /* Must be last item in struct */
472 struct spider_net_descr darray[0];
455}; 473};
456 474
457#define pr_err(fmt,arg...) \ 475#define pr_err(fmt,arg...) \