Deleted Added
full compact
oce_hw.c (252869) oce_hw.c (257007)
1/*-
2 * Copyright (C) 2013 Emulex
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

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

31 * Contact Information:
32 * freebsd-drivers@emulex.com
33 *
34 * Emulex
35 * 3333 Susan Street
36 * Costa Mesa, CA 92626
37 */
38
1/*-
2 * Copyright (C) 2013 Emulex
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

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

31 * Contact Information:
32 * freebsd-drivers@emulex.com
33 *
34 * Emulex
35 * 3333 Susan Street
36 * Costa Mesa, CA 92626
37 */
38
39/* $FreeBSD: head/sys/dev/oce/oce_hw.c 252869 2013-07-06 08:30:45Z delphij $ */
39/* $FreeBSD: head/sys/dev/oce/oce_hw.c 257007 2013-10-23 18:58:38Z delphij $ */
40
40
41
41#include "oce_if.h"
42
43static int oce_POST(POCE_SOFTC sc);
44
45/**
46 * @brief Function to post status
47 * @param sc software handle to the device
48 */

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

198 * @brief Function to get the PCI capabilities
199 * @param sc software handle to the device
200 */
201static
202void oce_get_pci_capabilities(POCE_SOFTC sc)
203{
204 uint32_t val;
205
42#include "oce_if.h"
43
44static int oce_POST(POCE_SOFTC sc);
45
46/**
47 * @brief Function to post status
48 * @param sc software handle to the device
49 */

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

199 * @brief Function to get the PCI capabilities
200 * @param sc software handle to the device
201 */
202static
203void oce_get_pci_capabilities(POCE_SOFTC sc)
204{
205 uint32_t val;
206
206 if (pci_find_cap(sc->dev, PCIY_PCIX, &val) == 0) {
207#if __FreeBSD_version >= 1000000
208 #define pci_find_extcap pci_find_cap
209#endif
210
211 if (pci_find_extcap(sc->dev, PCIY_PCIX, &val) == 0) {
207 if (val != 0)
208 sc->flags |= OCE_FLAGS_PCIX;
209 }
210
212 if (val != 0)
213 sc->flags |= OCE_FLAGS_PCIX;
214 }
215
211 if (pci_find_cap(sc->dev, PCIY_EXPRESS, &val) == 0) {
216 if (pci_find_extcap(sc->dev, PCIY_EXPRESS, &val) == 0) {
212 if (val != 0) {
213 uint16_t link_status =
214 pci_read_config(sc->dev, val + 0x12, 2);
215
216 sc->flags |= OCE_FLAGS_PCIE;
217 sc->pcie_link_speed = link_status & 0xf;
218 sc->pcie_link_width = (link_status >> 4) & 0x3f;
219 }
220 }
221
217 if (val != 0) {
218 uint16_t link_status =
219 pci_read_config(sc->dev, val + 0x12, 2);
220
221 sc->flags |= OCE_FLAGS_PCIE;
222 sc->pcie_link_speed = link_status & 0xf;
223 sc->pcie_link_width = (link_status >> 4) & 0x3f;
224 }
225 }
226
222 if (pci_find_cap(sc->dev, PCIY_MSI, &val) == 0) {
227 if (pci_find_extcap(sc->dev, PCIY_MSI, &val) == 0) {
223 if (val != 0)
224 sc->flags |= OCE_FLAGS_MSI_CAPABLE;
225 }
226
228 if (val != 0)
229 sc->flags |= OCE_FLAGS_MSI_CAPABLE;
230 }
231
227 if (pci_find_cap(sc->dev, PCIY_MSIX, &val) == 0) {
232 if (pci_find_extcap(sc->dev, PCIY_MSIX, &val) == 0) {
228 if (val != 0) {
229 val = pci_msix_count(sc->dev);
230 sc->flags |= OCE_FLAGS_MSIX_CAPABLE;
231 }
232 }
233}
234
235/**

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

381 capab_en_flags = OCE_CAPAB_ENABLE;
382
383 if (IS_XE201(sc)) {
384 /* LANCER A0 workaround */
385 capab_en_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR;
386 capab_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR;
387 }
388
233 if (val != 0) {
234 val = pci_msix_count(sc->dev);
235 sc->flags |= OCE_FLAGS_MSIX_CAPABLE;
236 }
237 }
238}
239
240/**

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

386 capab_en_flags = OCE_CAPAB_ENABLE;
387
388 if (IS_XE201(sc)) {
389 /* LANCER A0 workaround */
390 capab_en_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR;
391 capab_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR;
392 }
393
394 if (IS_SH(sc) || IS_XE201(sc))
395 capab_flags |= MBX_RX_IFACE_FLAGS_MULTICAST;
396
389 /* enable capabilities controlled via driver startup parameters */
390 if (is_rss_enabled(sc))
391 capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS;
392 else {
393 capab_en_flags &= ~MBX_RX_IFACE_FLAGS_RSS;
394 capab_flags &= ~MBX_RX_IFACE_FLAGS_RSS;
395 }
396

--- 191 unchanged lines hidden ---
397 /* enable capabilities controlled via driver startup parameters */
398 if (is_rss_enabled(sc))
399 capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS;
400 else {
401 capab_en_flags &= ~MBX_RX_IFACE_FLAGS_RSS;
402 capab_flags &= ~MBX_RX_IFACE_FLAGS_RSS;
403 }
404

--- 191 unchanged lines hidden ---