Deleted Added
full compact
qla_os.c (243857) qla_os.c (250340)
1/*
1/*
2 * Copyright (c) 2010-2011 Qlogic Corporation
2 * Copyright (c) 2011-2013 Qlogic Corporation
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
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.

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

26 */
27
28/*
29 * File: qla_os.c
30 * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
31 */
32
33#include <sys/cdefs.h>
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
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.

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

26 */
27
28/*
29 * File: qla_os.c
30 * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/qlxgb/qla_os.c 243857 2012-12-04 09:32:43Z glebius $");
34__FBSDID("$FreeBSD: head/sys/dev/qlxgb/qla_os.c 250340 2013-05-07 22:58:42Z davidcs $");
35
36#include "qla_os.h"
37#include "qla_reg.h"
38#include "qla_hw.h"
39#include "qla_def.h"
40#include "qla_inline.h"
41#include "qla_ver.h"
42#include "qla_glbl.h"

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

149 device_t dev = ha->pci_dev;
150
151 SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
152 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
153 OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RD,
154 (void *)ha, 0,
155 qla_sysctl_get_stats, "I", "Statistics");
156
35
36#include "qla_os.h"
37#include "qla_reg.h"
38#include "qla_hw.h"
39#include "qla_def.h"
40#include "qla_inline.h"
41#include "qla_ver.h"
42#include "qla_glbl.h"

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

149 device_t dev = ha->pci_dev;
150
151 SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
152 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
153 OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RD,
154 (void *)ha, 0,
155 qla_sysctl_get_stats, "I", "Statistics");
156
157 SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev),
158 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
159 OID_AUTO, "fw_version", CTLFLAG_RD,
160 &ha->fw_ver_str, 0, "firmware version");
161
157 dbg_level = 0;
158 SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
159 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
160 OID_AUTO, "debug", CTLFLAG_RW,
161 &dbg_level, dbg_level, "Debug Level");
162
163 SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
164 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),

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

342 device_printf(dev, "%s: qla_init_hw failed\n", __func__);
343 goto qla_pci_attach_err;
344 }
345
346 device_printf(dev, "%s: firmware[%d.%d.%d.%d]\n", __func__,
347 ha->fw_ver_major, ha->fw_ver_minor, ha->fw_ver_sub,
348 ha->fw_ver_build);
349
162 dbg_level = 0;
163 SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
164 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
165 OID_AUTO, "debug", CTLFLAG_RW,
166 &dbg_level, dbg_level, "Debug Level");
167
168 SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
169 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),

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

347 device_printf(dev, "%s: qla_init_hw failed\n", __func__);
348 goto qla_pci_attach_err;
349 }
350
351 device_printf(dev, "%s: firmware[%d.%d.%d.%d]\n", __func__,
352 ha->fw_ver_major, ha->fw_ver_minor, ha->fw_ver_sub,
353 ha->fw_ver_build);
354
355 snprintf(ha->fw_ver_str, sizeof(ha->fw_ver_str), "%d.%d.%d.%d",
356 ha->fw_ver_major, ha->fw_ver_minor, ha->fw_ver_sub,
357 ha->fw_ver_build);
358
350 //qla_get_hw_caps(ha);
351 qla_read_mac_addr(ha);
352
353 /* allocate parent dma tag */
354 if (qla_alloc_parent_dma_tag(ha)) {
355 device_printf(dev, "%s: qla_alloc_parent_dma_tag failed\n",
356 __func__);
357 goto qla_pci_attach_err;

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

655
656 ifp = ha->ifp = if_alloc(IFT_ETHER);
657
658 if (ifp == NULL)
659 panic("%s: cannot if_alloc()\n", device_get_nameunit(dev));
660
661 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
662
359 //qla_get_hw_caps(ha);
360 qla_read_mac_addr(ha);
361
362 /* allocate parent dma tag */
363 if (qla_alloc_parent_dma_tag(ha)) {
364 device_printf(dev, "%s: qla_alloc_parent_dma_tag failed\n",
365 __func__);
366 goto qla_pci_attach_err;

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

664
665 ifp = ha->ifp = if_alloc(IFT_ETHER);
666
667 if (ifp == NULL)
668 panic("%s: cannot if_alloc()\n", device_get_nameunit(dev));
669
670 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
671
672 ifp->if_mtu = ETHERMTU;
663 ifp->if_baudrate = (1 * 1000 * 1000 *1000);
664 ifp->if_init = qla_init;
665 ifp->if_softc = ha;
666 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
667 ifp->if_ioctl = qla_ioctl;
668 ifp->if_start = qla_start;
669
670 IFQ_SET_MAXLEN(&ifp->if_snd, qla_get_ifq_snd_maxlen(ha));

--- 809 unchanged lines hidden ---
673 ifp->if_baudrate = (1 * 1000 * 1000 *1000);
674 ifp->if_init = qla_init;
675 ifp->if_softc = ha;
676 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
677 ifp->if_ioctl = qla_ioctl;
678 ifp->if_start = qla_start;
679
680 IFQ_SET_MAXLEN(&ifp->if_snd, qla_get_ifq_snd_maxlen(ha));

--- 809 unchanged lines hidden ---