diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-01-02 05:39:10 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-01-31 04:59:08 -0500 |
commit | a608ab9cb6a5050394498b2520c6e7c162f4e2cf (patch) | |
tree | f22716ac7293bc77bab7fc48f4d8dbd0a2ecd57d /drivers/net/netxen/netxen_nic_hw.c | |
parent | f56df2f4db6e4af87fb8e941cff69f4501a111df (diff) |
netxen patches
Have fun.
>From 24f4a1a77431575a9cdfaae25adda85842099f70 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Mon, 1 Jan 2007 15:22:56 -0500
Subject: [PATCH] netxen trivial annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 191e2336e323..f263232f499f 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -95,7 +95,7 @@ void netxen_nic_set_multi(struct net_device *netdev) | |||
95 | struct netxen_port *port = netdev_priv(netdev); | 95 | struct netxen_port *port = netdev_priv(netdev); |
96 | struct netxen_adapter *adapter = port->adapter; | 96 | struct netxen_adapter *adapter = port->adapter; |
97 | struct dev_mc_list *mc_ptr; | 97 | struct dev_mc_list *mc_ptr; |
98 | __le32 netxen_mac_addr_cntl_data = 0; | 98 | __u32 netxen_mac_addr_cntl_data = 0; |
99 | 99 | ||
100 | mc_ptr = netdev->mc_list; | 100 | mc_ptr = netdev->mc_list; |
101 | if (netdev->flags & IFF_PROMISC) { | 101 | if (netdev->flags & IFF_PROMISC) { |
@@ -236,8 +236,9 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
236 | } | 236 | } |
237 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); | 237 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); |
238 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; | 238 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; |
239 | adapter->ctx_desc->cmd_consumer_offset = adapter->ctx_desc_phys_addr | 239 | adapter->ctx_desc->cmd_consumer_offset = |
240 | + sizeof(struct netxen_ring_ctx); | 240 | cpu_to_le64(adapter->ctx_desc_phys_addr + |
241 | sizeof(struct netxen_ring_ctx)); | ||
241 | adapter->cmd_consumer = (uint32_t *) (((char *)addr) + | 242 | adapter->cmd_consumer = (uint32_t *) (((char *)addr) + |
242 | sizeof(struct netxen_ring_ctx)); | 243 | sizeof(struct netxen_ring_ctx)); |
243 | 244 | ||
@@ -253,11 +254,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
253 | return -ENOMEM; | 254 | return -ENOMEM; |
254 | } | 255 | } |
255 | 256 | ||
256 | adapter->ctx_desc->cmd_ring_addr_lo = | 257 | adapter->ctx_desc->cmd_ring_addr = |
257 | hw->cmd_desc_phys_addr & 0xffffffffUL; | 258 | cpu_to_le64(hw->cmd_desc_phys_addr); |
258 | adapter->ctx_desc->cmd_ring_addr_hi = | 259 | adapter->ctx_desc->cmd_ring_size = |
259 | ((u64) hw->cmd_desc_phys_addr >> 32); | 260 | cpu_to_le32(adapter->max_tx_desc_count); |
260 | adapter->ctx_desc->cmd_ring_size = adapter->max_tx_desc_count; | ||
261 | 261 | ||
262 | hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; | 262 | hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; |
263 | 263 | ||
@@ -278,12 +278,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
278 | return err; | 278 | return err; |
279 | } | 279 | } |
280 | rcv_desc->desc_head = (struct rcv_desc *)addr; | 280 | rcv_desc->desc_head = (struct rcv_desc *)addr; |
281 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_lo = | 281 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr = |
282 | rcv_desc->phys_addr & 0xffffffffUL; | 282 | cpu_to_le64(rcv_desc->phys_addr); |
283 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_hi = | ||
284 | ((u64) rcv_desc->phys_addr >> 32); | ||
285 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = | 283 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = |
286 | rcv_desc->max_rx_desc_count; | 284 | cpu_to_le32(rcv_desc->max_rx_desc_count); |
287 | } | 285 | } |
288 | 286 | ||
289 | addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, | 287 | addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, |
@@ -297,11 +295,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
297 | return err; | 295 | return err; |
298 | } | 296 | } |
299 | recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; | 297 | recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; |
300 | adapter->ctx_desc->sts_ring_addr_lo = | 298 | adapter->ctx_desc->sts_ring_addr = |
301 | recv_ctx->rcv_status_desc_phys_addr & 0xffffffffUL; | 299 | cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); |
302 | adapter->ctx_desc->sts_ring_addr_hi = | 300 | adapter->ctx_desc->sts_ring_size = |
303 | ((u64) recv_ctx->rcv_status_desc_phys_addr >> 32); | 301 | cpu_to_le32(adapter->max_rx_desc_count); |
304 | adapter->ctx_desc->sts_ring_size = adapter->max_rx_desc_count; | ||
305 | 302 | ||
306 | } | 303 | } |
307 | /* Window = 1 */ | 304 | /* Window = 1 */ |
@@ -387,10 +384,6 @@ void netxen_tso_check(struct netxen_adapter *adapter, | |||
387 | } | 384 | } |
388 | adapter->stats.xmitcsummed++; | 385 | adapter->stats.xmitcsummed++; |
389 | desc->tcp_hdr_offset = skb->h.raw - skb->data; | 386 | desc->tcp_hdr_offset = skb->h.raw - skb->data; |
390 | netxen_set_cmd_desc_totallength(desc, | ||
391 | cpu_to_le32 | ||
392 | (netxen_get_cmd_desc_totallength | ||
393 | (desc))); | ||
394 | desc->ip_hdr_offset = skb->nh.raw - skb->data; | 387 | desc->ip_hdr_offset = skb->nh.raw - skb->data; |
395 | } | 388 | } |
396 | 389 | ||
@@ -867,9 +860,9 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off, | |||
867 | void netxen_nic_set_link_parameters(struct netxen_port *port) | 860 | void netxen_nic_set_link_parameters(struct netxen_port *port) |
868 | { | 861 | { |
869 | struct netxen_adapter *adapter = port->adapter; | 862 | struct netxen_adapter *adapter = port->adapter; |
870 | __le32 status; | 863 | __u32 status; |
871 | __le32 autoneg; | 864 | __u32 autoneg; |
872 | __le32 mode; | 865 | __u32 mode; |
873 | 866 | ||
874 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); | 867 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); |
875 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ | 868 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ |