Wed Jul 3 15:21:35 2013 UTC ()
 Fix the setting of sc->bge_flags for 5717 and newer devices. Reported by
Mike Belopuhov.


(msaitoh)
diff -r1.254 -r1.255 src/sys/dev/pci/if_bge.c

cvs diff -r1.254 -r1.255 src/sys/dev/pci/if_bge.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_bge.c 2013/07/03 05:49:36 1.254
+++ src/sys/dev/pci/if_bge.c 2013/07/03 15:21:35 1.255
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_bge.c,v 1.254 2013/07/03 05:49:36 msaitoh Exp $ */ 1/* $NetBSD: if_bge.c,v 1.255 2013/07/03 15:21:35 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Wind River Systems 4 * Copyright (c) 2001 Wind River Systems
5 * Copyright (c) 1997, 1998, 1999, 2001 5 * Copyright (c) 1997, 1998, 1999, 2001
6 * Bill Paul <wpaul@windriver.com>. All rights reserved. 6 * Bill Paul <wpaul@windriver.com>. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -69,27 +69,27 @@ @@ -69,27 +69,27 @@
69 * does not support external SSRAM. 69 * does not support external SSRAM.
70 * 70 *
71 * Broadcom also produces a variation of the BCM5700 under the "Altima" 71 * Broadcom also produces a variation of the BCM5700 under the "Altima"
72 * brand name, which is functionally similar but lacks PCI-X support. 72 * brand name, which is functionally similar but lacks PCI-X support.
73 * 73 *
74 * Without external SSRAM, you can only have at most 4 TX rings, 74 * Without external SSRAM, you can only have at most 4 TX rings,
75 * and the use of the mini RX ring is disabled. This seems to imply 75 * and the use of the mini RX ring is disabled. This seems to imply
76 * that these features are simply not available on the BCM5701. As a 76 * that these features are simply not available on the BCM5701. As a
77 * result, this driver does not implement any support for the mini RX 77 * result, this driver does not implement any support for the mini RX
78 * ring. 78 * ring.
79 */ 79 */
80 80
81#include <sys/cdefs.h> 81#include <sys/cdefs.h>
82__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.254 2013/07/03 05:49:36 msaitoh Exp $"); 82__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.255 2013/07/03 15:21:35 msaitoh Exp $");
83 83
84#include <sys/param.h> 84#include <sys/param.h>
85#include <sys/systm.h> 85#include <sys/systm.h>
86#include <sys/callout.h> 86#include <sys/callout.h>
87#include <sys/sockio.h> 87#include <sys/sockio.h>
88#include <sys/mbuf.h> 88#include <sys/mbuf.h>
89#include <sys/malloc.h> 89#include <sys/malloc.h>
90#include <sys/kernel.h> 90#include <sys/kernel.h>
91#include <sys/device.h> 91#include <sys/device.h>
92#include <sys/socket.h> 92#include <sys/socket.h>
93#include <sys/sysctl.h> 93#include <sys/sysctl.h>
94 94
95#include <net/if.h> 95#include <net/if.h>
@@ -3390,27 +3390,27 @@ bge_attach(device_t parent, device_t sel @@ -3390,27 +3390,27 @@ bge_attach(device_t parent, device_t sel
3390 switch (BGE_ASICREV(sc->bge_chipid)) { 3390 switch (BGE_ASICREV(sc->bge_chipid)) {
3391 case BGE_ASICREV_BCM57765: 3391 case BGE_ASICREV_BCM57765:
3392 case BGE_ASICREV_BCM57766: 3392 case BGE_ASICREV_BCM57766:
3393 sc->bge_flags |= BGE_57765_PLUS; 3393 sc->bge_flags |= BGE_57765_PLUS;
3394 /* FALLTHROUGH */ 3394 /* FALLTHROUGH */
3395 case BGE_ASICREV_BCM5717: 3395 case BGE_ASICREV_BCM5717:
3396 case BGE_ASICREV_BCM5719: 3396 case BGE_ASICREV_BCM5719:
3397 case BGE_ASICREV_BCM5720: 3397 case BGE_ASICREV_BCM5720:
3398 sc->bge_flags |= BGE_5717_PLUS | BGE_5755_PLUS | 3398 sc->bge_flags |= BGE_5717_PLUS | BGE_5755_PLUS |
3399 BGE_575X_PLUS | BGE_5705_PLUS | BGE_JUMBO_CAPABLE; 3399 BGE_575X_PLUS | BGE_5705_PLUS | BGE_JUMBO_CAPABLE;
3400 /* Jumbo frame on BCM5719 A0 does not work. */ 3400 /* Jumbo frame on BCM5719 A0 does not work. */
3401 if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5719) && 3401 if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5719) &&
3402 (sc->bge_chipid == BGE_CHIPID_BCM5719_A0)) 3402 (sc->bge_chipid == BGE_CHIPID_BCM5719_A0))
3403 sc->bge_flags |= ~BGE_JUMBO_CAPABLE; 3403 sc->bge_flags &= ~BGE_JUMBO_CAPABLE;
3404 break; 3404 break;
3405 case BGE_ASICREV_BCM5755: 3405 case BGE_ASICREV_BCM5755:
3406 case BGE_ASICREV_BCM5761: 3406 case BGE_ASICREV_BCM5761:
3407 case BGE_ASICREV_BCM5784: 3407 case BGE_ASICREV_BCM5784:
3408 case BGE_ASICREV_BCM5785: 3408 case BGE_ASICREV_BCM5785:
3409 case BGE_ASICREV_BCM5787: 3409 case BGE_ASICREV_BCM5787:
3410 case BGE_ASICREV_BCM57780: 3410 case BGE_ASICREV_BCM57780:
3411 sc->bge_flags |= BGE_5755_PLUS | BGE_575X_PLUS | BGE_5705_PLUS; 3411 sc->bge_flags |= BGE_5755_PLUS | BGE_575X_PLUS | BGE_5705_PLUS;
3412 break; 3412 break;
3413 case BGE_ASICREV_BCM5700: 3413 case BGE_ASICREV_BCM5700:
3414 case BGE_ASICREV_BCM5701: 3414 case BGE_ASICREV_BCM5701:
3415 case BGE_ASICREV_BCM5703: 3415 case BGE_ASICREV_BCM5703:
3416 case BGE_ASICREV_BCM5704: 3416 case BGE_ASICREV_BCM5704: