From: Jason Lunz <lunz@falooley.org>
To: netdev@oss.sgi.com
Subject: Re: e100-3.0.0_dev8 "Minneapolis Moline" release
Date: Wed, 18 Jun 2003 15:33:25 +0000 (UTC) [thread overview]
Message-ID: <slrnbf11i5.kck.lunz@stoli.localnet> (raw)
In-Reply-To: C6F5CF431189FA4CBAEC9E7DD5441E010107D977@orsmsx402.jf.intel.com
scott.feldman@intel.com said:
> Also, any feedback on the code correctness, maintainability, credits,
> etc. would help.
Is the anonymous union in struct cb some kind of gcc3-only thing? It
doesn't compile for my debian woody gcc 2.95 unless I name the union
member.
--
Jason Lunz Reflex Security
lunz@reflexsecurity.com http://www.reflexsecurity.com/
--- e100.c Tue Jun 17 08:51:45 2003
+++ e100.c.union Wed Jun 18 11:27:45 2003
@@ -434,7 +434,7 @@
u16 eol;
} tbd;
} tcb;
- };
+ } data;
struct cb *next, *prev;
dma_addr_t dma_addr;
struct sk_buff *skb;
@@ -867,7 +867,7 @@
static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
{
- struct config *config = &cb->config;
+ struct config *config = &cb->data.config;
u8 *c = (u8 *)config;
cb->command = cpu_to_le16(cb_config);
@@ -942,7 +942,7 @@
dev_addr[3], dev_addr[4], dev_addr[5]);
cb->command = cpu_to_le16(cb_iaaddr);
- memcpy(cb->iaaddr, dev_addr, ETH_ALEN);
+ memcpy(cb->data.iaaddr, dev_addr, ETH_ALEN);
}
#define NCONFIG_AUTO_SWITCH 0x0080
@@ -1051,9 +1051,9 @@
u16 i, count = min(netdev->mc_count, E100_MAX_MULTICAST_ADDRS);
cb->command = cpu_to_le16(cb_multi);
- cb->multi.count = cpu_to_le16(count * ETH_ALEN);
+ cb->data.multi.count = cpu_to_le16(count * ETH_ALEN);
for(i = 0; list && i < count; i++, list = list->next)
- memcpy(&cb->multi.addr[i*ETH_ALEN], &list->dmi_addr, ETH_ALEN);
+ memcpy(&cb->data.multi.addr[i*ETH_ALEN], &list->dmi_addr, ETH_ALEN);
}
static void e100_set_multicast_list(struct net_device *netdev)
@@ -1175,13 +1175,13 @@
struct sk_buff *skb)
{
cb->command = nic->tx_command;
- cb->tcb.tbd_array = cb->dma_addr + offsetof(struct cb, tcb.tbd);
- cb->tcb.tcb_byte_count = 0;
- cb->tcb.threshold = nic->tx_threshold;
- cb->tcb.tbd_count = 1;
- cb->tcb.tbd.buf_addr = cpu_to_le32(pci_map_single(nic->pdev,
+ cb->data.tcb.tbd_array = cb->dma_addr + offsetof(struct cb, data.tcb.tbd);
+ cb->data.tcb.tcb_byte_count = 0;
+ cb->data.tcb.threshold = nic->tx_threshold;
+ cb->data.tcb.tbd_count = 1;
+ cb->data.tcb.tbd.buf_addr = cpu_to_le32(pci_map_single(nic->pdev,
skb->data, skb->len, PCI_DMA_TODEVICE));
- cb->tcb.tbd.size = cpu_to_le16(skb->len);
+ cb->data.tcb.tbd.size = cpu_to_le16(skb->len);
}
static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
@@ -1217,8 +1217,8 @@
nic->net_stats.tx_bytes += cb->skb->len;
pci_unmap_single(nic->pdev,
- le32_to_cpu(cb->tcb.tbd.buf_addr),
- le16_to_cpu(cb->tcb.tbd.size),
+ le32_to_cpu(cb->data.tcb.tbd.buf_addr),
+ le16_to_cpu(cb->data.tcb.tbd.size),
PCI_DMA_TODEVICE);
dev_kfree_skb_irq(cb->skb);
tx_cleaned = 1;
@@ -1241,8 +1241,8 @@
struct cb *cb = nic->cb_to_clean;
if(cb->skb) {
pci_unmap_single(nic->pdev,
- le32_to_cpu(cb->tcb.tbd.buf_addr),
- le16_to_cpu(cb->tcb.tbd.size),
+ le32_to_cpu(cb->data.tcb.tbd.buf_addr),
+ le16_to_cpu(cb->data.tcb.tbd.size),
PCI_DMA_TODEVICE);
dev_kfree_skb_irq(cb->skb);
}
next prev parent reply other threads:[~2003-06-18 15:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-18 2:48 e100-3.0.0_dev8 "Minneapolis Moline" release Feldman, Scott
2003-06-18 15:33 ` Jason Lunz [this message]
2003-06-18 17:26 ` David S. Miller
2003-06-18 15:54 ` Jason Lunz
2003-06-23 17:45 ` Udo A. Steinberg
-- strict thread matches above, loose matches on Subject: below --
2003-06-18 16:39 Feldman, Scott
2003-06-18 16:52 Feldman, Scott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=slrnbf11i5.kck.lunz@stoli.localnet \
--to=lunz@falooley.org \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).