aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge/myri10ge.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 12:09:52 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 12:09:52 -0500
commit0a01707b289853f56d1c000057b27e243c039722 (patch)
treefe9aff3073e7232e2f786a4faf8f0974b65fdfb0 /drivers/net/myri10ge/myri10ge.c
parent2685b267bce34c9b66626cb11664509c32a761a5 (diff)
parent0ae851352a87db3f829511816a2da227860bf585 (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (43 commits) [wireless] zd1211rw: workqueue-related build fixes [netdrvr] netxen: workqueue-related build fixes [PATCH] sky2: sparse warnings [PATCH] skge: fix sparse warnings [PATCH] myri10ge: write as 2 32-byte blocks in myri10ge_submit_8rx [PATCH] sky2: receive queue watermark tweak [PATCH] sky2: beter ram buffer partitioning [PATCH] sky2: add comments to PCI ids [PATCH] sky2: add PCI for 88ec033 [PATCH] AT91RM9200 Ethernet: Use dev_alloc_skb() [PATCH] AT91RM9200 Ethernet: Add netpoll / netconsole support [PATCH] AT91RM9200 Ethernet: Move check_timer variable and use mod_timer() [PATCH] AT91RM9200 Ethernet: Remove 'at91_dev' and use netdev_priv() [PATCH] ipw2200: Fix debug output endian issue [PATCH] ipw2200: Fix a typo [PATCH] ipw2200: Update version stamp to 1.2.0 [PATCH] ipw2200: Add IEEE80211_RADIOTAP_TSFT for promiscuous mode [PATCH] softmac: fix unbalanced mutex_lock/unlock in ieee80211softmac_wx_set_mlme [PATCH] softmac: Fixed handling of deassociation from AP [PATCH] ipw2200: replace kmalloc+memset with kcalloc ...
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-rw-r--r--drivers/net/myri10ge/myri10ge.c95
1 files changed, 51 insertions, 44 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 38df42802386..81f127a78afa 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -89,7 +89,7 @@ MODULE_LICENSE("Dual BSD/GPL");
89#define MYRI10GE_EEPROM_STRINGS_SIZE 256 89#define MYRI10GE_EEPROM_STRINGS_SIZE 256
90#define MYRI10GE_MAX_SEND_DESC_TSO ((65536 / 2048) * 2) 90#define MYRI10GE_MAX_SEND_DESC_TSO ((65536 / 2048) * 2)
91 91
92#define MYRI10GE_NO_CONFIRM_DATA 0xffffffff 92#define MYRI10GE_NO_CONFIRM_DATA htonl(0xffffffff)
93#define MYRI10GE_NO_RESPONSE_RESULT 0xffffffff 93#define MYRI10GE_NO_RESPONSE_RESULT 0xffffffff
94 94
95struct myri10ge_rx_buffer_state { 95struct myri10ge_rx_buffer_state {
@@ -156,8 +156,8 @@ struct myri10ge_priv {
156 int sram_size; 156 int sram_size;
157 unsigned long board_span; 157 unsigned long board_span;
158 unsigned long iomem_base; 158 unsigned long iomem_base;
159 u32 __iomem *irq_claim; 159 __be32 __iomem *irq_claim;
160 u32 __iomem *irq_deassert; 160 __be32 __iomem *irq_deassert;
161 char *mac_addr_string; 161 char *mac_addr_string;
162 struct mcp_cmd_response *cmd; 162 struct mcp_cmd_response *cmd;
163 dma_addr_t cmd_bus; 163 dma_addr_t cmd_bus;
@@ -165,10 +165,10 @@ struct myri10ge_priv {
165 dma_addr_t fw_stats_bus; 165 dma_addr_t fw_stats_bus;
166 struct pci_dev *pdev; 166 struct pci_dev *pdev;
167 int msi_enabled; 167 int msi_enabled;
168 unsigned int link_state; 168 __be32 link_state;
169 unsigned int rdma_tags_available; 169 unsigned int rdma_tags_available;
170 int intr_coal_delay; 170 int intr_coal_delay;
171 u32 __iomem *intr_coal_delay_ptr; 171 __be32 __iomem *intr_coal_delay_ptr;
172 int mtrr; 172 int mtrr;
173 int wake_queue; 173 int wake_queue;
174 int stop_queue; 174 int stop_queue;
@@ -273,6 +273,11 @@ MODULE_PARM_DESC(myri10ge_debug, "Debug level (0=none,...,16=all)");
273 273
274#define myri10ge_pio_copy(to,from,size) __iowrite64_copy(to,from,size/8) 274#define myri10ge_pio_copy(to,from,size) __iowrite64_copy(to,from,size/8)
275 275
276static inline void put_be32(__be32 val, __be32 __iomem *p)
277{
278 __raw_writel((__force __u32)val, (__force void __iomem *)p);
279}
280
276static int 281static int
277myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd, 282myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd,
278 struct myri10ge_cmd *data, int atomic) 283 struct myri10ge_cmd *data, int atomic)
@@ -296,7 +301,7 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd,
296 301
297 buf->response_addr.low = htonl(dma_low); 302 buf->response_addr.low = htonl(dma_low);
298 buf->response_addr.high = htonl(dma_high); 303 buf->response_addr.high = htonl(dma_high);
299 response->result = MYRI10GE_NO_RESPONSE_RESULT; 304 response->result = htonl(MYRI10GE_NO_RESPONSE_RESULT);
300 mb(); 305 mb();
301 myri10ge_pio_copy(cmd_addr, buf, sizeof(*buf)); 306 myri10ge_pio_copy(cmd_addr, buf, sizeof(*buf));
302 307
@@ -311,14 +316,14 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd,
311 * (1ms will be enough for those commands) */ 316 * (1ms will be enough for those commands) */
312 for (sleep_total = 0; 317 for (sleep_total = 0;
313 sleep_total < 1000 318 sleep_total < 1000
314 && response->result == MYRI10GE_NO_RESPONSE_RESULT; 319 && response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT);
315 sleep_total += 10) 320 sleep_total += 10)
316 udelay(10); 321 udelay(10);
317 } else { 322 } else {
318 /* use msleep for most command */ 323 /* use msleep for most command */
319 for (sleep_total = 0; 324 for (sleep_total = 0;
320 sleep_total < 15 325 sleep_total < 15
321 && response->result == MYRI10GE_NO_RESPONSE_RESULT; 326 && response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT);
322 sleep_total++) 327 sleep_total++)
323 msleep(1); 328 msleep(1);
324 } 329 }
@@ -393,7 +398,7 @@ abort:
393static void myri10ge_dummy_rdma(struct myri10ge_priv *mgp, int enable) 398static void myri10ge_dummy_rdma(struct myri10ge_priv *mgp, int enable)
394{ 399{
395 char __iomem *submit; 400 char __iomem *submit;
396 u32 buf[16]; 401 __be32 buf[16];
397 u32 dma_low, dma_high; 402 u32 dma_low, dma_high;
398 int i; 403 int i;
399 404
@@ -410,7 +415,7 @@ static void myri10ge_dummy_rdma(struct myri10ge_priv *mgp, int enable)
410 415
411 buf[0] = htonl(dma_high); /* confirm addr MSW */ 416 buf[0] = htonl(dma_high); /* confirm addr MSW */
412 buf[1] = htonl(dma_low); /* confirm addr LSW */ 417 buf[1] = htonl(dma_low); /* confirm addr LSW */
413 buf[2] = htonl(MYRI10GE_NO_CONFIRM_DATA); /* confirm data */ 418 buf[2] = MYRI10GE_NO_CONFIRM_DATA; /* confirm data */
414 buf[3] = htonl(dma_high); /* dummy addr MSW */ 419 buf[3] = htonl(dma_high); /* dummy addr MSW */
415 buf[4] = htonl(dma_low); /* dummy addr LSW */ 420 buf[4] = htonl(dma_low); /* dummy addr LSW */
416 buf[5] = htonl(enable); /* enable? */ 421 buf[5] = htonl(enable); /* enable? */
@@ -479,7 +484,7 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
479 } 484 }
480 485
481 /* check id */ 486 /* check id */
482 hdr_offset = ntohl(*(u32 *) (fw->data + MCP_HEADER_PTR_OFFSET)); 487 hdr_offset = ntohl(*(__be32 *) (fw->data + MCP_HEADER_PTR_OFFSET));
483 if ((hdr_offset & 3) || hdr_offset + sizeof(*hdr) > fw->size) { 488 if ((hdr_offset & 3) || hdr_offset + sizeof(*hdr) > fw->size) {
484 dev_err(dev, "Bad firmware file\n"); 489 dev_err(dev, "Bad firmware file\n");
485 status = -EINVAL; 490 status = -EINVAL;
@@ -550,7 +555,7 @@ static int myri10ge_adopt_running_firmware(struct myri10ge_priv *mgp)
550static int myri10ge_load_firmware(struct myri10ge_priv *mgp) 555static int myri10ge_load_firmware(struct myri10ge_priv *mgp)
551{ 556{
552 char __iomem *submit; 557 char __iomem *submit;
553 u32 buf[16]; 558 __be32 buf[16];
554 u32 dma_low, dma_high, size; 559 u32 dma_low, dma_high, size;
555 int status, i; 560 int status, i;
556 561
@@ -600,7 +605,7 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp)
600 605
601 buf[0] = htonl(dma_high); /* confirm addr MSW */ 606 buf[0] = htonl(dma_high); /* confirm addr MSW */
602 buf[1] = htonl(dma_low); /* confirm addr LSW */ 607 buf[1] = htonl(dma_low); /* confirm addr LSW */
603 buf[2] = htonl(MYRI10GE_NO_CONFIRM_DATA); /* confirm data */ 608 buf[2] = MYRI10GE_NO_CONFIRM_DATA; /* confirm data */
604 609
605 /* FIX: All newest firmware should un-protect the bottom of 610 /* FIX: All newest firmware should un-protect the bottom of
606 * the sram before handoff. However, the very first interfaces 611 * the sram before handoff. However, the very first interfaces
@@ -705,21 +710,21 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
705 710
706 status |= 711 status |=
707 myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_IRQ_ACK_OFFSET, &cmd, 0); 712 myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_IRQ_ACK_OFFSET, &cmd, 0);
708 mgp->irq_claim = (__iomem u32 *) (mgp->sram + cmd.data0); 713 mgp->irq_claim = (__iomem __be32 *) (mgp->sram + cmd.data0);
709 if (!mgp->msi_enabled) { 714 if (!mgp->msi_enabled) {
710 status |= myri10ge_send_cmd 715 status |= myri10ge_send_cmd
711 (mgp, MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET, &cmd, 0); 716 (mgp, MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET, &cmd, 0);
712 mgp->irq_deassert = (__iomem u32 *) (mgp->sram + cmd.data0); 717 mgp->irq_deassert = (__iomem __be32 *) (mgp->sram + cmd.data0);
713 718
714 } 719 }
715 status |= myri10ge_send_cmd 720 status |= myri10ge_send_cmd
716 (mgp, MXGEFW_CMD_GET_INTR_COAL_DELAY_OFFSET, &cmd, 0); 721 (mgp, MXGEFW_CMD_GET_INTR_COAL_DELAY_OFFSET, &cmd, 0);
717 mgp->intr_coal_delay_ptr = (__iomem u32 *) (mgp->sram + cmd.data0); 722 mgp->intr_coal_delay_ptr = (__iomem __be32 *) (mgp->sram + cmd.data0);
718 if (status != 0) { 723 if (status != 0) {
719 dev_err(&mgp->pdev->dev, "failed set interrupt parameters\n"); 724 dev_err(&mgp->pdev->dev, "failed set interrupt parameters\n");
720 return status; 725 return status;
721 } 726 }
722 __raw_writel(htonl(mgp->intr_coal_delay), mgp->intr_coal_delay_ptr); 727 put_be32(htonl(mgp->intr_coal_delay), mgp->intr_coal_delay_ptr);
723 728
724 /* Run a small DMA test. 729 /* Run a small DMA test.
725 * The magic multipliers to the length tell the firmware 730 * The magic multipliers to the length tell the firmware
@@ -786,14 +791,16 @@ static inline void
786myri10ge_submit_8rx(struct mcp_kreq_ether_recv __iomem * dst, 791myri10ge_submit_8rx(struct mcp_kreq_ether_recv __iomem * dst,
787 struct mcp_kreq_ether_recv *src) 792 struct mcp_kreq_ether_recv *src)
788{ 793{
789 u32 low; 794 __be32 low;
790 795
791 low = src->addr_low; 796 low = src->addr_low;
792 src->addr_low = DMA_32BIT_MASK; 797 src->addr_low = htonl(DMA_32BIT_MASK);
793 myri10ge_pio_copy(dst, src, 8 * sizeof(*src)); 798 myri10ge_pio_copy(dst, src, 4 * sizeof(*src));
799 mb();
800 myri10ge_pio_copy(dst + 4, src + 4, 4 * sizeof(*src));
794 mb(); 801 mb();
795 src->addr_low = low; 802 src->addr_low = low;
796 __raw_writel(low, &dst->addr_low); 803 put_be32(low, &dst->addr_low);
797 mb(); 804 mb();
798} 805}
799 806
@@ -939,11 +946,11 @@ done:
939 return retval; 946 return retval;
940} 947}
941 948
942static inline void myri10ge_vlan_ip_csum(struct sk_buff *skb, u16 hw_csum) 949static inline void myri10ge_vlan_ip_csum(struct sk_buff *skb, __wsum hw_csum)
943{ 950{
944 struct vlan_hdr *vh = (struct vlan_hdr *)(skb->data); 951 struct vlan_hdr *vh = (struct vlan_hdr *)(skb->data);
945 952
946 if ((skb->protocol == ntohs(ETH_P_8021Q)) && 953 if ((skb->protocol == htons(ETH_P_8021Q)) &&
947 (vh->h_vlan_encapsulated_proto == htons(ETH_P_IP) || 954 (vh->h_vlan_encapsulated_proto == htons(ETH_P_IP) ||
948 vh->h_vlan_encapsulated_proto == htons(ETH_P_IPV6))) { 955 vh->h_vlan_encapsulated_proto == htons(ETH_P_IPV6))) {
949 skb->csum = hw_csum; 956 skb->csum = hw_csum;
@@ -953,7 +960,7 @@ static inline void myri10ge_vlan_ip_csum(struct sk_buff *skb, u16 hw_csum)
953 960
954static inline unsigned long 961static inline unsigned long
955myri10ge_rx_done(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx, 962myri10ge_rx_done(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
956 int bytes, int len, int csum) 963 int bytes, int len, __wsum csum)
957{ 964{
958 dma_addr_t bus; 965 dma_addr_t bus;
959 struct sk_buff *skb; 966 struct sk_buff *skb;
@@ -986,12 +993,12 @@ myri10ge_rx_done(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
986 993
987 skb->protocol = eth_type_trans(skb, mgp->dev); 994 skb->protocol = eth_type_trans(skb, mgp->dev);
988 if (mgp->csum_flag) { 995 if (mgp->csum_flag) {
989 if ((skb->protocol == ntohs(ETH_P_IP)) || 996 if ((skb->protocol == htons(ETH_P_IP)) ||
990 (skb->protocol == ntohs(ETH_P_IPV6))) { 997 (skb->protocol == htons(ETH_P_IPV6))) {
991 skb->csum = ntohs((u16) csum); 998 skb->csum = csum;
992 skb->ip_summed = CHECKSUM_COMPLETE; 999 skb->ip_summed = CHECKSUM_COMPLETE;
993 } else 1000 } else
994 myri10ge_vlan_ip_csum(skb, ntohs((u16) csum)); 1001 myri10ge_vlan_ip_csum(skb, csum);
995 } 1002 }
996 1003
997 netif_receive_skb(skb); 1004 netif_receive_skb(skb);
@@ -1060,12 +1067,12 @@ static inline void myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int *limit)
1060 int idx = rx_done->idx; 1067 int idx = rx_done->idx;
1061 int cnt = rx_done->cnt; 1068 int cnt = rx_done->cnt;
1062 u16 length; 1069 u16 length;
1063 u16 checksum; 1070 __wsum checksum;
1064 1071
1065 while (rx_done->entry[idx].length != 0 && *limit != 0) { 1072 while (rx_done->entry[idx].length != 0 && *limit != 0) {
1066 length = ntohs(rx_done->entry[idx].length); 1073 length = ntohs(rx_done->entry[idx].length);
1067 rx_done->entry[idx].length = 0; 1074 rx_done->entry[idx].length = 0;
1068 checksum = ntohs(rx_done->entry[idx].checksum); 1075 checksum = csum_unfold(rx_done->entry[idx].checksum);
1069 if (length <= mgp->small_bytes) 1076 if (length <= mgp->small_bytes)
1070 rx_ok = myri10ge_rx_done(mgp, &mgp->rx_small, 1077 rx_ok = myri10ge_rx_done(mgp, &mgp->rx_small,
1071 mgp->small_bytes, 1078 mgp->small_bytes,
@@ -1142,7 +1149,7 @@ static int myri10ge_poll(struct net_device *netdev, int *budget)
1142 1149
1143 if (rx_done->entry[rx_done->idx].length == 0 || !netif_running(netdev)) { 1150 if (rx_done->entry[rx_done->idx].length == 0 || !netif_running(netdev)) {
1144 netif_rx_complete(netdev); 1151 netif_rx_complete(netdev);
1145 __raw_writel(htonl(3), mgp->irq_claim); 1152 put_be32(htonl(3), mgp->irq_claim);
1146 return 0; 1153 return 0;
1147 } 1154 }
1148 return 1; 1155 return 1;
@@ -1166,7 +1173,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
1166 netif_rx_schedule(mgp->dev); 1173 netif_rx_schedule(mgp->dev);
1167 1174
1168 if (!mgp->msi_enabled) { 1175 if (!mgp->msi_enabled) {
1169 __raw_writel(0, mgp->irq_deassert); 1176 put_be32(0, mgp->irq_deassert);
1170 if (!myri10ge_deassert_wait) 1177 if (!myri10ge_deassert_wait)
1171 stats->valid = 0; 1178 stats->valid = 0;
1172 mb(); 1179 mb();
@@ -1195,7 +1202,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
1195 1202
1196 myri10ge_check_statblock(mgp); 1203 myri10ge_check_statblock(mgp);
1197 1204
1198 __raw_writel(htonl(3), mgp->irq_claim + 1); 1205 put_be32(htonl(3), mgp->irq_claim + 1);
1199 return (IRQ_HANDLED); 1206 return (IRQ_HANDLED);
1200} 1207}
1201 1208
@@ -1233,7 +1240,7 @@ myri10ge_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coal)
1233 struct myri10ge_priv *mgp = netdev_priv(netdev); 1240 struct myri10ge_priv *mgp = netdev_priv(netdev);
1234 1241
1235 mgp->intr_coal_delay = coal->rx_coalesce_usecs; 1242 mgp->intr_coal_delay = coal->rx_coalesce_usecs;
1236 __raw_writel(htonl(mgp->intr_coal_delay), mgp->intr_coal_delay_ptr); 1243 put_be32(htonl(mgp->intr_coal_delay), mgp->intr_coal_delay_ptr);
1237 return 0; 1244 return 0;
1238} 1245}
1239 1246
@@ -1748,7 +1755,7 @@ static int myri10ge_open(struct net_device *dev)
1748 goto abort_with_rings; 1755 goto abort_with_rings;
1749 } 1756 }
1750 1757
1751 mgp->link_state = -1; 1758 mgp->link_state = htonl(~0U);
1752 mgp->rdma_tags_available = 15; 1759 mgp->rdma_tags_available = 15;
1753 1760
1754 netif_poll_enable(mgp->dev); /* must happen prior to any irq */ 1761 netif_poll_enable(mgp->dev); /* must happen prior to any irq */
@@ -1876,7 +1883,7 @@ myri10ge_submit_req(struct myri10ge_tx_buf *tx, struct mcp_kreq_ether_send *src,
1876 1883
1877 /* re-write the last 32-bits with the valid flags */ 1884 /* re-write the last 32-bits with the valid flags */
1878 src->flags = last_flags; 1885 src->flags = last_flags;
1879 __raw_writel(*((u32 *) src + 3), (u32 __iomem *) dst + 3); 1886 put_be32(*((__be32 *) src + 3), (__be32 __iomem *) dst + 3);
1880 tx->req += cnt; 1887 tx->req += cnt;
1881 mb(); 1888 mb();
1882} 1889}
@@ -1919,7 +1926,8 @@ static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev)
1919 struct myri10ge_tx_buf *tx = &mgp->tx; 1926 struct myri10ge_tx_buf *tx = &mgp->tx;
1920 struct skb_frag_struct *frag; 1927 struct skb_frag_struct *frag;
1921 dma_addr_t bus; 1928 dma_addr_t bus;
1922 u32 low, high_swapped; 1929 u32 low;
1930 __be32 high_swapped;
1923 unsigned int len; 1931 unsigned int len;
1924 int idx, last_idx, avail, frag_cnt, frag_idx, count, mss, max_segments; 1932 int idx, last_idx, avail, frag_cnt, frag_idx, count, mss, max_segments;
1925 u16 pseudo_hdr_offset, cksum_offset; 1933 u16 pseudo_hdr_offset, cksum_offset;
@@ -1964,7 +1972,6 @@ again:
1964 cksum_offset = 0; 1972 cksum_offset = 0;
1965 pseudo_hdr_offset = 0; 1973 pseudo_hdr_offset = 0;
1966 } else { 1974 } else {
1967 pseudo_hdr_offset = htons(pseudo_hdr_offset);
1968 odd_flag = MXGEFW_FLAGS_ALIGN_ODD; 1975 odd_flag = MXGEFW_FLAGS_ALIGN_ODD;
1969 flags |= MXGEFW_FLAGS_CKSUM; 1976 flags |= MXGEFW_FLAGS_CKSUM;
1970 } 1977 }
@@ -1986,7 +1993,7 @@ again:
1986 /* for TSO, pseudo_hdr_offset holds mss. 1993 /* for TSO, pseudo_hdr_offset holds mss.
1987 * The firmware figures out where to put 1994 * The firmware figures out where to put
1988 * the checksum by parsing the header. */ 1995 * the checksum by parsing the header. */
1989 pseudo_hdr_offset = htons(mss); 1996 pseudo_hdr_offset = mss;
1990 } else 1997 } else
1991#endif /*NETIF_F_TSO */ 1998#endif /*NETIF_F_TSO */
1992 /* Mark small packets, and pad out tiny packets */ 1999 /* Mark small packets, and pad out tiny packets */
@@ -2086,7 +2093,7 @@ again:
2086#endif /* NETIF_F_TSO */ 2093#endif /* NETIF_F_TSO */
2087 req->addr_high = high_swapped; 2094 req->addr_high = high_swapped;
2088 req->addr_low = htonl(low); 2095 req->addr_low = htonl(low);
2089 req->pseudo_hdr_offset = pseudo_hdr_offset; 2096 req->pseudo_hdr_offset = htons(pseudo_hdr_offset);
2090 req->pad = 0; /* complete solid 16-byte block; does this matter? */ 2097 req->pad = 0; /* complete solid 16-byte block; does this matter? */
2091 req->rdma_count = 1; 2098 req->rdma_count = 1;
2092 req->length = htons(seglen); 2099 req->length = htons(seglen);
@@ -2199,6 +2206,7 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
2199 struct myri10ge_cmd cmd; 2206 struct myri10ge_cmd cmd;
2200 struct myri10ge_priv *mgp; 2207 struct myri10ge_priv *mgp;
2201 struct dev_mc_list *mc_list; 2208 struct dev_mc_list *mc_list;
2209 __be32 data[2] = {0, 0};
2202 int err; 2210 int err;
2203 2211
2204 mgp = netdev_priv(dev); 2212 mgp = netdev_priv(dev);
@@ -2237,10 +2245,9 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
2237 2245
2238 /* Walk the multicast list, and add each address */ 2246 /* Walk the multicast list, and add each address */
2239 for (mc_list = dev->mc_list; mc_list != NULL; mc_list = mc_list->next) { 2247 for (mc_list = dev->mc_list; mc_list != NULL; mc_list = mc_list->next) {
2240 memcpy(&cmd.data0, &mc_list->dmi_addr, 4); 2248 memcpy(data, &mc_list->dmi_addr, 6);
2241 memcpy(&cmd.data1, ((char *)&mc_list->dmi_addr) + 4, 2); 2249 cmd.data0 = ntohl(data[0]);
2242 cmd.data0 = htonl(cmd.data0); 2250 cmd.data1 = ntohl(data[1]);
2243 cmd.data1 = htonl(cmd.data1);
2244 err = myri10ge_send_cmd(mgp, MXGEFW_JOIN_MULTICAST_GROUP, 2251 err = myri10ge_send_cmd(mgp, MXGEFW_JOIN_MULTICAST_GROUP,
2245 &cmd, 1); 2252 &cmd, 1);
2246 2253