Commit 4cb6f9e5 authored by Linas Vepstas's avatar Linas Vepstas Committed by Jeff Garzik

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: default avatarLinas Vepstas <linas@austin.ibm.com>
Cc: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 4b23a554
This diff is collapsed.
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifndef _SPIDER_NET_H #ifndef _SPIDER_NET_H
#define _SPIDER_NET_H #define _SPIDER_NET_H
#define VERSION "1.6 B" #define VERSION "1.6 C"
#include "sungem_phy.h" #include "sungem_phy.h"
...@@ -364,8 +364,8 @@ enum spider_net_int2_status { ...@@ -364,8 +364,8 @@ enum spider_net_int2_status {
#define SPIDER_NET_DESCR_NOT_IN_USE 0xF0000000 #define SPIDER_NET_DESCR_NOT_IN_USE 0xF0000000
#define SPIDER_NET_DESCR_TXDESFLG 0x00800000 #define SPIDER_NET_DESCR_TXDESFLG 0x00800000
struct spider_net_descr { /* Descriptor, as defined by the hardware */
/* as defined by the hardware */ struct spider_net_hw_descr {
u32 buf_addr; u32 buf_addr;
u32 buf_size; u32 buf_size;
u32 next_descr_addr; u32 next_descr_addr;
...@@ -374,13 +374,15 @@ struct spider_net_descr { ...@@ -374,13 +374,15 @@ struct spider_net_descr {
u32 valid_size; /* all zeroes for tx */ u32 valid_size; /* all zeroes for tx */
u32 data_status; u32 data_status;
u32 data_error; /* all zeroes for tx */ u32 data_error; /* all zeroes for tx */
} __attribute__((aligned(32)));
/* used in the driver */ struct spider_net_descr {
struct spider_net_hw_descr *hwdescr;
struct sk_buff *skb; struct sk_buff *skb;
u32 bus_addr; u32 bus_addr;
struct spider_net_descr *next; struct spider_net_descr *next;
struct spider_net_descr *prev; struct spider_net_descr *prev;
} __attribute__((aligned(32))); };
struct spider_net_descr_chain { struct spider_net_descr_chain {
spinlock_t lock; spinlock_t lock;
...@@ -388,6 +390,7 @@ struct spider_net_descr_chain { ...@@ -388,6 +390,7 @@ struct spider_net_descr_chain {
struct spider_net_descr *tail; struct spider_net_descr *tail;
struct spider_net_descr *ring; struct spider_net_descr *ring;
int num_desc; int num_desc;
struct spider_net_hw_descr *hwring;
dma_addr_t dma_addr; dma_addr_t dma_addr;
}; };
...@@ -464,6 +467,9 @@ struct spider_net_card { ...@@ -464,6 +467,9 @@ struct spider_net_card {
struct net_device_stats netdev_stats; struct net_device_stats netdev_stats;
struct spider_net_extra_stats spider_stats; struct spider_net_extra_stats spider_stats;
struct spider_net_options options; struct spider_net_options options;
/* Must be last item in struct */
struct spider_net_descr darray[0];
}; };
#define pr_err(fmt,arg...) \ #define pr_err(fmt,arg...) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment