diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2008-07-31 16:10:10 -0400 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2008-07-31 17:08:04 -0400 |
commit | 0fe9f15ee8bd652242a778ddfd30aa6d97a98e23 (patch) | |
tree | 04051defa1e9e6924a5a169aa09aaf68ae07828e /drivers/net/via-velocity.h | |
parent | 031cf19e6f63941506c9baf76ac7adac06edcf08 (diff) |
via-velocity: separated struct allow wholesale copy during MTU changes.
It should help people fix the bugs in my code :o)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/net/via-velocity.h')
-rw-r--r-- | drivers/net/via-velocity.h | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h index 86446147284c..1b95b04c9257 100644 --- a/drivers/net/via-velocity.h +++ b/drivers/net/via-velocity.h | |||
@@ -1494,6 +1494,10 @@ struct velocity_opt { | |||
1494 | u32 flags; | 1494 | u32 flags; |
1495 | }; | 1495 | }; |
1496 | 1496 | ||
1497 | #define AVAIL_TD(p,q) ((p)->options.numtx-((p)->tx.used[(q)])) | ||
1498 | |||
1499 | #define GET_RD_BY_IDX(vptr, idx) (vptr->rd_ring[idx]) | ||
1500 | |||
1497 | struct velocity_info { | 1501 | struct velocity_info { |
1498 | struct list_head list; | 1502 | struct list_head list; |
1499 | 1503 | ||
@@ -1501,9 +1505,6 @@ struct velocity_info { | |||
1501 | struct net_device *dev; | 1505 | struct net_device *dev; |
1502 | struct net_device_stats stats; | 1506 | struct net_device_stats stats; |
1503 | 1507 | ||
1504 | dma_addr_t rd_pool_dma; | ||
1505 | dma_addr_t td_pool_dma[TX_QUEUE_NO]; | ||
1506 | |||
1507 | struct vlan_group *vlgrp; | 1508 | struct vlan_group *vlgrp; |
1508 | u8 ip_addr[4]; | 1509 | u8 ip_addr[4]; |
1509 | enum chip_type chip_id; | 1510 | enum chip_type chip_id; |
@@ -1512,25 +1513,29 @@ struct velocity_info { | |||
1512 | unsigned long memaddr; | 1513 | unsigned long memaddr; |
1513 | unsigned long ioaddr; | 1514 | unsigned long ioaddr; |
1514 | 1515 | ||
1515 | u8 rev_id; | 1516 | struct tx_info { |
1516 | 1517 | int numq; | |
1517 | #define AVAIL_TD(p,q) ((p)->options.numtx-((p)->td_used[(q)])) | 1518 | |
1519 | /* FIXME: the locality of the data seems rather poor. */ | ||
1520 | int used[TX_QUEUE_NO]; | ||
1521 | int curr[TX_QUEUE_NO]; | ||
1522 | int tail[TX_QUEUE_NO]; | ||
1523 | struct tx_desc *rings[TX_QUEUE_NO]; | ||
1524 | struct velocity_td_info *infos[TX_QUEUE_NO]; | ||
1525 | dma_addr_t pool_dma[TX_QUEUE_NO]; | ||
1526 | } tx; | ||
1527 | |||
1528 | struct rx_info { | ||
1529 | int buf_sz; | ||
1530 | |||
1531 | int dirty; | ||
1532 | int curr; | ||
1533 | u32 filled; | ||
1534 | struct rx_desc *ring; | ||
1535 | struct velocity_rd_info *info; /* It's an array */ | ||
1536 | dma_addr_t pool_dma; | ||
1537 | } rx; | ||
1518 | 1538 | ||
1519 | int num_txq; | ||
1520 | |||
1521 | volatile int td_used[TX_QUEUE_NO]; | ||
1522 | int td_curr[TX_QUEUE_NO]; | ||
1523 | int td_tail[TX_QUEUE_NO]; | ||
1524 | struct tx_desc *td_rings[TX_QUEUE_NO]; | ||
1525 | struct velocity_td_info *td_infos[TX_QUEUE_NO]; | ||
1526 | |||
1527 | int rd_curr; | ||
1528 | int rd_dirty; | ||
1529 | u32 rd_filled; | ||
1530 | struct rx_desc *rd_ring; | ||
1531 | struct velocity_rd_info *rd_info; /* It's an array */ | ||
1532 | |||
1533 | #define GET_RD_BY_IDX(vptr, idx) (vptr->rd_ring[idx]) | ||
1534 | u32 mib_counter[MAX_HW_MIB_COUNTER]; | 1539 | u32 mib_counter[MAX_HW_MIB_COUNTER]; |
1535 | struct velocity_opt options; | 1540 | struct velocity_opt options; |
1536 | 1541 | ||
@@ -1538,7 +1543,6 @@ struct velocity_info { | |||
1538 | 1543 | ||
1539 | u32 flags; | 1544 | u32 flags; |
1540 | 1545 | ||
1541 | int rx_buf_sz; | ||
1542 | u32 mii_status; | 1546 | u32 mii_status; |
1543 | u32 phy_id; | 1547 | u32 phy_id; |
1544 | int multicast_limit; | 1548 | int multicast_limit; |
@@ -1554,8 +1558,8 @@ struct velocity_info { | |||
1554 | struct velocity_context context; | 1558 | struct velocity_context context; |
1555 | 1559 | ||
1556 | u32 ticks; | 1560 | u32 ticks; |
1557 | u32 rx_bytes; | ||
1558 | 1561 | ||
1562 | u8 rev_id; | ||
1559 | }; | 1563 | }; |
1560 | 1564 | ||
1561 | /** | 1565 | /** |