aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/spider_net.h
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-02-20 17:40:06 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-27 04:16:03 -0500
commit4cb6f9e57d5d7c26d08809c1ce6310c8a7dc96d2 (patch)
tree28d5202963a7f11e40d57eae3a5d2a1271f1f677 /drivers/net/spider_net.h
parent4b23a554db1571306d9e9cfb2321c3a44770371e (diff)
spidernet: separate hardware state from driver state.
This patch separates the hardware descriptor state from the driver descriptor state, per (old) suggestion from Ben Herrenschmidt. This compiles and boots and seems to work. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: Jens Osterkamp <Jens.Osterkamp@de.ibm.com> Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/spider_net.h')
-rw-r--r--drivers/net/spider_net.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/net/spider_net.h b/drivers/net/spider_net.h
index f7d1310ff473..a1a42d5821b5 100644
--- a/drivers/net/spider_net.h
+++ b/drivers/net/spider_net.h
@@ -25,7 +25,7 @@
25#ifndef _SPIDER_NET_H 25#ifndef _SPIDER_NET_H
26#define _SPIDER_NET_H 26#define _SPIDER_NET_H
27 27
28#define VERSION "1.6 B" 28#define VERSION "1.6 C"
29 29
30#include "sungem_phy.h" 30#include "sungem_phy.h"
31 31
@@ -364,8 +364,8 @@ enum spider_net_int2_status {
364#define SPIDER_NET_DESCR_NOT_IN_USE 0xF0000000 364#define SPIDER_NET_DESCR_NOT_IN_USE 0xF0000000
365#define SPIDER_NET_DESCR_TXDESFLG 0x00800000 365#define SPIDER_NET_DESCR_TXDESFLG 0x00800000
366 366
367struct spider_net_descr { 367/* Descriptor, as defined by the hardware */
368 /* as defined by the hardware */ 368struct spider_net_hw_descr {
369 u32 buf_addr; 369 u32 buf_addr;
370 u32 buf_size; 370 u32 buf_size;
371 u32 next_descr_addr; 371 u32 next_descr_addr;
@@ -374,13 +374,15 @@ struct spider_net_descr {
374 u32 valid_size; /* all zeroes for tx */ 374 u32 valid_size; /* all zeroes for tx */
375 u32 data_status; 375 u32 data_status;
376 u32 data_error; /* all zeroes for tx */ 376 u32 data_error; /* all zeroes for tx */
377} __attribute__((aligned(32)));
377 378
378 /* used in the driver */ 379struct spider_net_descr {
380 struct spider_net_hw_descr *hwdescr;
379 struct sk_buff *skb; 381 struct sk_buff *skb;
380 u32 bus_addr; 382 u32 bus_addr;
381 struct spider_net_descr *next; 383 struct spider_net_descr *next;
382 struct spider_net_descr *prev; 384 struct spider_net_descr *prev;
383} __attribute__((aligned(32))); 385};
384 386
385struct spider_net_descr_chain { 387struct spider_net_descr_chain {
386 spinlock_t lock; 388 spinlock_t lock;
@@ -388,6 +390,7 @@ struct spider_net_descr_chain {
388 struct spider_net_descr *tail; 390 struct spider_net_descr *tail;
389 struct spider_net_descr *ring; 391 struct spider_net_descr *ring;
390 int num_desc; 392 int num_desc;
393 struct spider_net_hw_descr *hwring;
391 dma_addr_t dma_addr; 394 dma_addr_t dma_addr;
392}; 395};
393 396
@@ -464,6 +467,9 @@ struct spider_net_card {
464 struct net_device_stats netdev_stats; 467 struct net_device_stats netdev_stats;
465 struct spider_net_extra_stats spider_stats; 468 struct spider_net_extra_stats spider_stats;
466 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];
467}; 473};
468 474
469#define pr_err(fmt,arg...) \ 475#define pr_err(fmt,arg...) \