Thu Nov 30 09:24:18 2017 UTC ()
- 82583 supports jumbo frame. Fixes PR#52773 reported by Shinichi Doyashiki.
- Cleanup comment.


(msaitoh)
diff -r1.545 -r1.546 src/sys/dev/pci/if_wm.c

cvs diff -r1.545 -r1.546 src/sys/dev/pci/if_wm.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wm.c 2017/11/30 03:53:24 1.545
+++ src/sys/dev/pci/if_wm.c 2017/11/30 09:24:18 1.546
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wm.c,v 1.545 2017/11/30 03:53:24 msaitoh Exp $ */ 1/* $NetBSD: if_wm.c,v 1.546 2017/11/30 09:24:18 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -73,27 +73,27 @@ @@ -73,27 +73,27 @@
73 * TODO (in order of importance): 73 * TODO (in order of importance):
74 * 74 *
75 * - Check XXX'ed comments 75 * - Check XXX'ed comments
76 * - TX Multi queue improvement (refine queue selection logic) 76 * - TX Multi queue improvement (refine queue selection logic)
77 * - Split header buffer for newer descriptors 77 * - Split header buffer for newer descriptors
78 * - EEE (Energy Efficiency Ethernet) 78 * - EEE (Energy Efficiency Ethernet)
79 * - Virtual Function 79 * - Virtual Function
80 * - Set LED correctly (based on contents in EEPROM) 80 * - Set LED correctly (based on contents in EEPROM)
81 * - Rework how parameters are loaded from the EEPROM. 81 * - Rework how parameters are loaded from the EEPROM.
82 * - Image Unique ID 82 * - Image Unique ID
83 */ 83 */
84 84
85#include <sys/cdefs.h> 85#include <sys/cdefs.h>
86__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.545 2017/11/30 03:53:24 msaitoh Exp $"); 86__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.546 2017/11/30 09:24:18 msaitoh Exp $");
87 87
88#ifdef _KERNEL_OPT 88#ifdef _KERNEL_OPT
89#include "opt_net_mpsafe.h" 89#include "opt_net_mpsafe.h"
90#include "opt_if_wm.h" 90#include "opt_if_wm.h"
91#endif 91#endif
92 92
93#include <sys/param.h> 93#include <sys/param.h>
94#include <sys/systm.h> 94#include <sys/systm.h>
95#include <sys/callout.h> 95#include <sys/callout.h>
96#include <sys/mbuf.h> 96#include <sys/mbuf.h>
97#include <sys/malloc.h> 97#include <sys/malloc.h>
98#include <sys/kmem.h> 98#include <sys/kmem.h>
99#include <sys/kernel.h> 99#include <sys/kernel.h>
@@ -2666,49 +2666,49 @@ alloc_retry: @@ -2666,49 +2666,49 @@ alloc_retry:
2666 IFQ_SET_READY(&ifp->if_snd); 2666 IFQ_SET_READY(&ifp->if_snd);
2667 2667
2668 /* Check for jumbo frame */ 2668 /* Check for jumbo frame */
2669 switch (sc->sc_type) { 2669 switch (sc->sc_type) {
2670 case WM_T_82573: 2670 case WM_T_82573:
2671 /* XXX limited to 9234 if ASPM is disabled */ 2671 /* XXX limited to 9234 if ASPM is disabled */
2672 wm_nvm_read(sc, NVM_OFF_INIT_3GIO_3, 1, &nvmword); 2672 wm_nvm_read(sc, NVM_OFF_INIT_3GIO_3, 1, &nvmword);
2673 if ((nvmword & NVM_3GIO_3_ASPM_MASK) != 0) 2673 if ((nvmword & NVM_3GIO_3_ASPM_MASK) != 0)
2674 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU; 2674 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
2675 break; 2675 break;
2676 case WM_T_82571: 2676 case WM_T_82571:
2677 case WM_T_82572: 2677 case WM_T_82572:
2678 case WM_T_82574: 2678 case WM_T_82574:
 2679 case WM_T_82583:
2679 case WM_T_82575: 2680 case WM_T_82575:
2680 case WM_T_82576: 2681 case WM_T_82576:
2681 case WM_T_82580: 2682 case WM_T_82580:
2682 case WM_T_I350: 2683 case WM_T_I350:
2683 case WM_T_I354: /* XXXX ok? */ 2684 case WM_T_I354:
2684 case WM_T_I210: 2685 case WM_T_I210:
2685 case WM_T_I211: 2686 case WM_T_I211:
2686 case WM_T_80003: 2687 case WM_T_80003:
2687 case WM_T_ICH9: 2688 case WM_T_ICH9:
2688 case WM_T_ICH10: 2689 case WM_T_ICH10:
2689 case WM_T_PCH2: /* PCH2 supports 9K frame size */ 2690 case WM_T_PCH2: /* PCH2 supports 9K frame size */
2690 case WM_T_PCH_LPT: 2691 case WM_T_PCH_LPT:
2691 case WM_T_PCH_SPT: 2692 case WM_T_PCH_SPT:
2692 /* XXX limited to 9234 */ 2693 /* XXX limited to 9234 */
2693 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU; 2694 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
2694 break; 2695 break;
2695 case WM_T_PCH: 2696 case WM_T_PCH:
2696 /* XXX limited to 4096 */ 2697 /* XXX limited to 4096 */
2697 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU; 2698 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
2698 break; 2699 break;
2699 case WM_T_82542_2_0: 2700 case WM_T_82542_2_0:
2700 case WM_T_82542_2_1: 2701 case WM_T_82542_2_1:
2701 case WM_T_82583: 
2702 case WM_T_ICH8: 2702 case WM_T_ICH8:
2703 /* No support for jumbo frame */ 2703 /* No support for jumbo frame */
2704 break; 2704 break;
2705 default: 2705 default:
2706 /* ETHER_MAX_LEN_JUMBO */ 2706 /* ETHER_MAX_LEN_JUMBO */
2707 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU; 2707 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
2708 break; 2708 break;
2709 } 2709 }
2710 2710
2711 /* If we're a i82543 or greater, we can support VLANs. */ 2711 /* If we're a i82543 or greater, we can support VLANs. */
2712 if (sc->sc_type >= WM_T_82543) 2712 if (sc->sc_type >= WM_T_82543)
2713 sc->sc_ethercom.ec_capabilities |= 2713 sc->sc_ethercom.ec_capabilities |=
2714 ETHERCAP_VLAN_MTU | ETHERCAP_VLAN_HWTAGGING; 2714 ETHERCAP_VLAN_MTU | ETHERCAP_VLAN_HWTAGGING;