Deleted Added
full compact
if_mxge.c (162322) if_mxge.c (162328)
1/******************************************************************************
2
3Copyright (c) 2006, Myricom Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 18 unchanged lines hidden (view full) ---

27INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30POSSIBILITY OF SUCH DAMAGE.
31
32***************************************************************************/
33
34#include <sys/cdefs.h>
1/******************************************************************************
2
3Copyright (c) 2006, Myricom Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 18 unchanged lines hidden (view full) ---

27INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30POSSIBILITY OF SUCH DAMAGE.
31
32***************************************************************************/
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/dev/mxge/if_mxge.c 162322 2006-09-15 15:41:28Z gallatin $");
35__FBSDID("$FreeBSD: head/sys/dev/mxge/if_mxge.c 162328 2006-09-15 19:24:45Z gallatin $");
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/linker.h>
40#include <sys/firmware.h>
41#include <sys/endian.h>
42#include <sys/sockio.h>
43#include <sys/mbuf.h>

--- 377 unchanged lines hidden (view full) ---

421 if (mxge_verbose)
422 device_printf(sc->dev,
423 "Assuming aligned completions"
424 " (ECRC)\n");
425 }
426 }
427 /* see if the upstream bridge is known to
428 provided aligned completions */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/linker.h>
40#include <sys/firmware.h>
41#include <sys/endian.h>
42#include <sys/sockio.h>
43#include <sys/mbuf.h>

--- 377 unchanged lines hidden (view full) ---

421 if (mxge_verbose)
422 device_printf(sc->dev,
423 "Assuming aligned completions"
424 " (ECRC)\n");
425 }
426 }
427 /* see if the upstream bridge is known to
428 provided aligned completions */
429 if (/* HT2000 */ (pvend == 0x1166 && pdid == 0x0132) ||
430 /* Ontario */ (pvend == 0x10b5 && pdid == 0x8532)) {
429 if (/* HT2000 */ (pvend == 0x1166 && pdid == 0x0132) ||
430 /* PLX */ (pvend == 0x10b5 && pdid == 0x8532) ||
431 /* Intel */ (pvend == 0x8086 &&
432 /* E5000 */(pdid >= 0x25f7 && pdid <= 0x25fa))) {
431 if (mxge_verbose)
432 device_printf(sc->dev,
433 "Assuming aligned completions "
434 "(0x%x:0x%x)\n", pvend, pdid);
435 }
436
437abort:
438 if (aligned) {

--- 135 unchanged lines hidden (view full) ---

574 buf[2] = htobe32(0xffffffff); /* confirm data */
575 dma_low = MXGE_LOWPART_TO_U32(sc->zeropad_dma.bus_addr);
576 dma_high = MXGE_HIGHPART_TO_U32(sc->zeropad_dma.bus_addr);
577 buf[3] = htobe32(dma_high); /* dummy addr MSW */
578 buf[4] = htobe32(dma_low); /* dummy addr LSW */
579 buf[5] = htobe32(enable); /* enable? */
580
581
433 if (mxge_verbose)
434 device_printf(sc->dev,
435 "Assuming aligned completions "
436 "(0x%x:0x%x)\n", pvend, pdid);
437 }
438
439abort:
440 if (aligned) {

--- 135 unchanged lines hidden (view full) ---

576 buf[2] = htobe32(0xffffffff); /* confirm data */
577 dma_low = MXGE_LOWPART_TO_U32(sc->zeropad_dma.bus_addr);
578 dma_high = MXGE_HIGHPART_TO_U32(sc->zeropad_dma.bus_addr);
579 buf[3] = htobe32(dma_high); /* dummy addr MSW */
580 buf[4] = htobe32(dma_low); /* dummy addr LSW */
581 buf[5] = htobe32(enable); /* enable? */
582
583
582 submit = (volatile char *)(sc->sram + 0xfc01c0);
584 submit = (volatile char *)(sc->sram + MXGEFW_BOOT_DUMMY_RDMA);
583
584 mxge_pio_copy(submit, buf, 64);
585 mb();
586 DELAY(1000);
587 mb();
588 i = 0;
589 while (*confirm != 0xffffffff && i < 20) {
590 DELAY(1000);

--- 8 unchanged lines hidden (view full) ---

599}
600
601static int
602mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data)
603{
604 mcp_cmd_t *buf;
605 char buf_bytes[sizeof(*buf) + 8];
606 volatile mcp_cmd_response_t *response = sc->cmd;
585
586 mxge_pio_copy(submit, buf, 64);
587 mb();
588 DELAY(1000);
589 mb();
590 i = 0;
591 while (*confirm != 0xffffffff && i < 20) {
592 DELAY(1000);

--- 8 unchanged lines hidden (view full) ---

601}
602
603static int
604mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data)
605{
606 mcp_cmd_t *buf;
607 char buf_bytes[sizeof(*buf) + 8];
608 volatile mcp_cmd_response_t *response = sc->cmd;
607 volatile char *cmd_addr = sc->sram + MXGEFW_CMD_OFFSET;
609 volatile char *cmd_addr = sc->sram + MXGEFW_ETH_CMD;
608 uint32_t dma_low, dma_high;
609 int sleep_total = 0;
610
611 /* ensure buf is aligned to 8 bytes */
612 buf = (mcp_cmd_t *)((unsigned long)(buf_bytes + 7) & ~7UL);
613
614 buf->data0 = htobe32(data->data0);
615 buf->data1 = htobe32(data->data1);

--- 127 unchanged lines hidden (view full) ---

743 do not. Therefore the handoff copy must skip the first 8 bytes
744 */
745 /* where the code starts*/
746 buf[3] = htobe32(MXGE_FW_OFFSET + 8);
747 buf[4] = htobe32(size - 8); /* length of code */
748 buf[5] = htobe32(8); /* where to copy to */
749 buf[6] = htobe32(0); /* where to jump to */
750
610 uint32_t dma_low, dma_high;
611 int sleep_total = 0;
612
613 /* ensure buf is aligned to 8 bytes */
614 buf = (mcp_cmd_t *)((unsigned long)(buf_bytes + 7) & ~7UL);
615
616 buf->data0 = htobe32(data->data0);
617 buf->data1 = htobe32(data->data1);

--- 127 unchanged lines hidden (view full) ---

745 do not. Therefore the handoff copy must skip the first 8 bytes
746 */
747 /* where the code starts*/
748 buf[3] = htobe32(MXGE_FW_OFFSET + 8);
749 buf[4] = htobe32(size - 8); /* length of code */
750 buf[5] = htobe32(8); /* where to copy to */
751 buf[6] = htobe32(0); /* where to jump to */
752
751 submit = (volatile char *)(sc->sram + 0xfc0000);
753 submit = (volatile char *)(sc->sram + MXGEFW_BOOT_HANDOFF);
752 mxge_pio_copy(submit, buf, 64);
753 mb();
754 DELAY(1000);
755 mb();
756 i = 0;
757 while (*confirm != 0xffffffff && i < 20) {
758 DELAY(1000*10);
759 i++;

--- 60 unchanged lines hidden (view full) ---

820 status = mxge_send_cmd(sc, MXGEFW_DISABLE_PROMISC,
821 &cmd);
822
823 if (status) {
824 device_printf(sc->dev, "Failed to set promisc mode\n");
825 }
826}
827
754 mxge_pio_copy(submit, buf, 64);
755 mb();
756 DELAY(1000);
757 mb();
758 i = 0;
759 while (*confirm != 0xffffffff && i < 20) {
760 DELAY(1000*10);
761 i++;

--- 60 unchanged lines hidden (view full) ---

822 status = mxge_send_cmd(sc, MXGEFW_DISABLE_PROMISC,
823 &cmd);
824
825 if (status) {
826 device_printf(sc->dev, "Failed to set promisc mode\n");
827 }
828}
829
830static void
831mxge_set_multicast_list(mxge_softc_t *sc)
832{
833 mxge_cmd_t cmd;
834 struct ifmultiaddr *ifma;
835 struct ifnet *ifp = sc->ifp;
836 int err;
837
838 /* This firmware is known to not support multicast */
839 if (!sc->fw_multicast_support)
840 return;
841
842 /* Disable multicast filtering while we play with the lists*/
843 err = mxge_send_cmd(sc, MXGEFW_ENABLE_ALLMULTI, &cmd);
844 if (err != 0) {
845 device_printf(sc->dev, "Failed MXGEFW_ENABLE_ALLMULTI,"
846 " error status: %d\n", err);
847 return;
848 }
849
850
851 if (ifp->if_flags & IFF_ALLMULTI)
852 /* request to disable multicast filtering, so quit here */
853 return;
854
855 /* Flush all the filters */
856
857 err = mxge_send_cmd(sc, MXGEFW_LEAVE_ALL_MULTICAST_GROUPS, &cmd);
858 if (err != 0) {
859 device_printf(sc->dev,
860 "Failed MXGEFW_LEAVE_ALL_MULTICAST_GROUPS"
861 ", error status: %d\n", err);
862 return;
863 }
864
865 /* Walk the multicast list, and add each address */
866
867 IF_ADDR_LOCK(ifp);
868 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
869 if (ifma->ifma_addr->sa_family != AF_LINK)
870 continue;
871 bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
872 &cmd.data0, 4);
873 bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr) + 4,
874 &cmd.data1, 2);
875 cmd.data0 = htonl(cmd.data0);
876 cmd.data1 = htonl(cmd.data1);
877 err = mxge_send_cmd(sc, MXGEFW_JOIN_MULTICAST_GROUP, &cmd);
878 if (err != 0) {
879 device_printf(sc->dev, "Failed "
880 "MXGEFW_JOIN_MULTICAST_GROUP, error status:"
881 "%d\t", err);
882 /* abort, leaving multicast filtering off */
883 IF_ADDR_UNLOCK(ifp);
884 return;
885 }
886 }
887 IF_ADDR_UNLOCK(ifp);
888 /* Enable multicast filtering */
889 err = mxge_send_cmd(sc, MXGEFW_DISABLE_ALLMULTI, &cmd);
890 if (err != 0) {
891 device_printf(sc->dev, "Failed MXGEFW_DISABLE_ALLMULTI"
892 ", error status: %d\n", err);
893 }
894}
895
896
828static int
829mxge_reset(mxge_softc_t *sc)
830{
831
832 mxge_cmd_t cmd;
833 mxge_dma_t dmabench_dma;
834 size_t bytes;
835 int status;

--- 91 unchanged lines hidden (view full) ---

927 sc->tx.done = 0;
928 sc->tx.pkt_done = 0;
929 sc->rx_big.cnt = 0;
930 sc->rx_small.cnt = 0;
931 sc->rdma_tags_available = 15;
932 status = mxge_update_mac_address(sc);
933 mxge_change_promisc(sc, 0);
934 mxge_change_pause(sc, sc->pause);
897static int
898mxge_reset(mxge_softc_t *sc)
899{
900
901 mxge_cmd_t cmd;
902 mxge_dma_t dmabench_dma;
903 size_t bytes;
904 int status;

--- 91 unchanged lines hidden (view full) ---

996 sc->tx.done = 0;
997 sc->tx.pkt_done = 0;
998 sc->rx_big.cnt = 0;
999 sc->rx_small.cnt = 0;
1000 sc->rdma_tags_available = 15;
1001 status = mxge_update_mac_address(sc);
1002 mxge_change_promisc(sc, 0);
1003 mxge_change_pause(sc, sc->pause);
1004 mxge_set_multicast_list(sc);
935 return status;
936}
937
938static int
939mxge_change_intr_coal(SYSCTL_HANDLER_ARGS)
940{
941 mxge_softc_t *sc;
942 unsigned int intr_coal_delay;

--- 138 unchanged lines hidden (view full) ---

1081 "I", "dropped_link_overflow");
1082 SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
1083 "dropped_link_error_or_filtered",
1084 CTLTYPE_INT|CTLFLAG_RD,
1085 &fw->dropped_link_error_or_filtered,
1086 0, mxge_handle_be32,
1087 "I", "dropped_link_error_or_filtered");
1088 SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
1005 return status;
1006}
1007
1008static int
1009mxge_change_intr_coal(SYSCTL_HANDLER_ARGS)
1010{
1011 mxge_softc_t *sc;
1012 unsigned int intr_coal_delay;

--- 138 unchanged lines hidden (view full) ---

1151 "I", "dropped_link_overflow");
1152 SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
1153 "dropped_link_error_or_filtered",
1154 CTLTYPE_INT|CTLFLAG_RD,
1155 &fw->dropped_link_error_or_filtered,
1156 0, mxge_handle_be32,
1157 "I", "dropped_link_error_or_filtered");
1158 SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
1159 "dropped_multicast_filtered",
1160 CTLTYPE_INT|CTLFLAG_RD,
1161 &fw->dropped_multicast_filtered,
1162 0, mxge_handle_be32,
1163 "I", "dropped_multicast_filtered");
1164 SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
1089 "dropped_runt",
1090 CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_runt,
1091 0, mxge_handle_be32,
1092 "I", "dropped_runt");
1093 SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
1094 "dropped_overrun",
1095 CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_overrun,
1096 0, mxge_handle_be32,

--- 123 unchanged lines hidden (view full) ---

1220 mxge_pio_copy((volatile char *)tx->wc_fifo, src, 64);
1221 mb();
1222 src += 4;
1223 cnt -= 4;
1224 }
1225 if (cnt > 0) {
1226 /* pad it to 64 bytes. The src is 64 bytes bigger than it
1227 needs to be so that we don't overrun it */
1165 "dropped_runt",
1166 CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_runt,
1167 0, mxge_handle_be32,
1168 "I", "dropped_runt");
1169 SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
1170 "dropped_overrun",
1171 CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_overrun,
1172 0, mxge_handle_be32,

--- 123 unchanged lines hidden (view full) ---

1296 mxge_pio_copy((volatile char *)tx->wc_fifo, src, 64);
1297 mb();
1298 src += 4;
1299 cnt -= 4;
1300 }
1301 if (cnt > 0) {
1302 /* pad it to 64 bytes. The src is 64 bytes bigger than it
1303 needs to be so that we don't overrun it */
1228 mxge_pio_copy(tx->wc_fifo + (cnt<<18), src, 64);
1304 mxge_pio_copy(tx->wc_fifo + MXGEFW_ETH_SEND_OFFSET(cnt), src, 64);
1229 mb();
1230 }
1231}
1232
1233static void
1234mxge_encap_tso(mxge_softc_t *sc, struct mbuf *m, int busdma_seg_cnt)
1235{
1236 mxge_tx_buf_t *tx;

--- 1024 unchanged lines hidden (view full) ---

2261}
2262
2263static int
2264mxge_open(mxge_softc_t *sc)
2265{
2266 mxge_cmd_t cmd;
2267 int i, err;
2268 bus_dmamap_t map;
1305 mb();
1306 }
1307}
1308
1309static void
1310mxge_encap_tso(mxge_softc_t *sc, struct mbuf *m, int busdma_seg_cnt)
1311{
1312 mxge_tx_buf_t *tx;

--- 1024 unchanged lines hidden (view full) ---

2337}
2338
2339static int
2340mxge_open(mxge_softc_t *sc)
2341{
2342 mxge_cmd_t cmd;
2343 int i, err;
2344 bus_dmamap_t map;
2345 bus_addr_t bus;
2269
2270
2271 /* Copy the MAC address in case it was overridden */
2272 bcopy(IF_LLADDR(sc->ifp), sc->mac_addr, ETHER_ADDR_LEN);
2273
2274 err = mxge_reset(sc);
2275 if (err != 0) {
2276 device_printf(sc->dev, "failed to reset\n");

--- 35 unchanged lines hidden (view full) ---

2312 if (err != 0) {
2313 device_printf(sc->dev,
2314 "failed to get ring sizes or locations\n");
2315 err = EIO;
2316 goto abort_with_irq;
2317 }
2318
2319 if (sc->wc) {
2346
2347
2348 /* Copy the MAC address in case it was overridden */
2349 bcopy(IF_LLADDR(sc->ifp), sc->mac_addr, ETHER_ADDR_LEN);
2350
2351 err = mxge_reset(sc);
2352 if (err != 0) {
2353 device_printf(sc->dev, "failed to reset\n");

--- 35 unchanged lines hidden (view full) ---

2389 if (err != 0) {
2390 device_printf(sc->dev,
2391 "failed to get ring sizes or locations\n");
2392 err = EIO;
2393 goto abort_with_irq;
2394 }
2395
2396 if (sc->wc) {
2320 sc->tx.wc_fifo = sc->sram + 0x200000;
2321 sc->rx_small.wc_fifo = sc->sram + 0x300000;
2322 sc->rx_big.wc_fifo = sc->sram + 0x340000;
2397 sc->tx.wc_fifo = sc->sram + MXGEFW_ETH_SEND_4;
2398 sc->rx_small.wc_fifo = sc->sram + MXGEFW_ETH_RECV_SMALL;
2399 sc->rx_big.wc_fifo = sc->sram + MXGEFW_ETH_RECV_BIG;
2323 } else {
2324 sc->tx.wc_fifo = 0;
2325 sc->rx_small.wc_fifo = 0;
2326 sc->rx_big.wc_fifo = 0;
2327 }
2328
2329
2330 /* stock receive rings */

--- 21 unchanged lines hidden (view full) ---

2352 of two. Luckily, FreeBSD's clusters are powers of two */
2353 cmd.data0 = sc->ifp->if_mtu + ETHER_HDR_LEN;
2354 err = mxge_send_cmd(sc, MXGEFW_CMD_SET_MTU, &cmd);
2355 cmd.data0 = MHLEN;
2356 err |= mxge_send_cmd(sc, MXGEFW_CMD_SET_SMALL_BUFFER_SIZE,
2357 &cmd);
2358 cmd.data0 = sc->big_bytes;
2359 err |= mxge_send_cmd(sc, MXGEFW_CMD_SET_BIG_BUFFER_SIZE, &cmd);
2400 } else {
2401 sc->tx.wc_fifo = 0;
2402 sc->rx_small.wc_fifo = 0;
2403 sc->rx_big.wc_fifo = 0;
2404 }
2405
2406
2407 /* stock receive rings */

--- 21 unchanged lines hidden (view full) ---

2429 of two. Luckily, FreeBSD's clusters are powers of two */
2430 cmd.data0 = sc->ifp->if_mtu + ETHER_HDR_LEN;
2431 err = mxge_send_cmd(sc, MXGEFW_CMD_SET_MTU, &cmd);
2432 cmd.data0 = MHLEN;
2433 err |= mxge_send_cmd(sc, MXGEFW_CMD_SET_SMALL_BUFFER_SIZE,
2434 &cmd);
2435 cmd.data0 = sc->big_bytes;
2436 err |= mxge_send_cmd(sc, MXGEFW_CMD_SET_BIG_BUFFER_SIZE, &cmd);
2437
2438 if (err != 0) {
2439 device_printf(sc->dev, "failed to setup params\n");
2440 goto abort;
2441 }
2442
2360 /* Now give him the pointer to the stats block */
2361 cmd.data0 = MXGE_LOWPART_TO_U32(sc->fw_stats_dma.bus_addr);
2362 cmd.data1 = MXGE_HIGHPART_TO_U32(sc->fw_stats_dma.bus_addr);
2443 /* Now give him the pointer to the stats block */
2444 cmd.data0 = MXGE_LOWPART_TO_U32(sc->fw_stats_dma.bus_addr);
2445 cmd.data1 = MXGE_HIGHPART_TO_U32(sc->fw_stats_dma.bus_addr);
2363 err = mxge_send_cmd(sc, MXGEFW_CMD_SET_STATS_DMA, &cmd);
2446 cmd.data2 = sizeof(struct mcp_irq_data);
2447 err = mxge_send_cmd(sc, MXGEFW_CMD_SET_STATS_DMA_V2, &cmd);
2364
2365 if (err != 0) {
2448
2449 if (err != 0) {
2450 bus = sc->fw_stats_dma.bus_addr;
2451 bus += offsetof(struct mcp_irq_data, send_done_count);
2452 cmd.data0 = MXGE_LOWPART_TO_U32(bus);
2453 cmd.data1 = MXGE_HIGHPART_TO_U32(bus);
2454 err = mxge_send_cmd(sc,
2455 MXGEFW_CMD_SET_STATS_DMA_OBSOLETE,
2456 &cmd);
2457 /* Firmware cannot support multicast without STATS_DMA_V2 */
2458 sc->fw_multicast_support = 0;
2459 } else {
2460 sc->fw_multicast_support = 1;
2461 }
2462
2463 if (err != 0) {
2366 device_printf(sc->dev, "failed to setup params\n");
2367 goto abort;
2368 }
2369
2370 /* Finally, start the firmware running */
2371 err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_UP, &cmd);
2372 if (err) {
2373 device_printf(sc->dev, "Couldn't bring up link\n");

--- 108 unchanged lines hidden (view full) ---

2482 err = mxge_change_mtu(sc, ifr->ifr_mtu);
2483 break;
2484
2485 case SIOCSIFFLAGS:
2486 sx_xlock(&sc->driver_lock);
2487 if (ifp->if_flags & IFF_UP) {
2488 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
2489 err = mxge_open(sc);
2464 device_printf(sc->dev, "failed to setup params\n");
2465 goto abort;
2466 }
2467
2468 /* Finally, start the firmware running */
2469 err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_UP, &cmd);
2470 if (err) {
2471 device_printf(sc->dev, "Couldn't bring up link\n");

--- 108 unchanged lines hidden (view full) ---

2580 err = mxge_change_mtu(sc, ifr->ifr_mtu);
2581 break;
2582
2583 case SIOCSIFFLAGS:
2584 sx_xlock(&sc->driver_lock);
2585 if (ifp->if_flags & IFF_UP) {
2586 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
2587 err = mxge_open(sc);
2588 else {
2589 /* take care of promis can allmulti
2590 flag chages */
2591 mxge_change_promisc(sc,
2592 ifp->if_flags & IFF_PROMISC);
2593 mxge_set_multicast_list(sc);
2594 }
2490 } else {
2491 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2492 mxge_close(sc);
2493 }
2494 sx_xunlock(&sc->driver_lock);
2495 break;
2496
2497 case SIOCADDMULTI:
2498 case SIOCDELMULTI:
2595 } else {
2596 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2597 mxge_close(sc);
2598 }
2599 sx_xunlock(&sc->driver_lock);
2600 break;
2601
2602 case SIOCADDMULTI:
2603 case SIOCDELMULTI:
2499 err = 0;
2604 sx_xlock(&sc->driver_lock);
2605 mxge_set_multicast_list(sc);
2606 sx_xunlock(&sc->driver_lock);
2500 break;
2501
2502 case SIOCSIFCAP:
2503 sx_xlock(&sc->driver_lock);
2504 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
2505 if (mask & IFCAP_TXCSUM) {
2506 if (IFCAP_TXCSUM & ifp->if_capenable) {
2507 ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4);

--- 281 unchanged lines hidden ---
2607 break;
2608
2609 case SIOCSIFCAP:
2610 sx_xlock(&sc->driver_lock);
2611 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
2612 if (mask & IFCAP_TXCSUM) {
2613 if (IFCAP_TXCSUM & ifp->if_capenable) {
2614 ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4);

--- 281 unchanged lines hidden ---