Deleted Added
sdiff udiff text old ( 252869 ) new ( 257007 )
full compact
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 $ */
40
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
206 if (pci_find_cap(sc->dev, PCIY_PCIX, &val) == 0) {
207 if (val != 0)
208 sc->flags |= OCE_FLAGS_PCIX;
209 }
210
211 if (pci_find_cap(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
222 if (pci_find_cap(sc->dev, PCIY_MSI, &val) == 0) {
223 if (val != 0)
224 sc->flags |= OCE_FLAGS_MSI_CAPABLE;
225 }
226
227 if (pci_find_cap(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
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 ---