summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2016-03-08 08:13:37 +0000
committernp <np@FreeBSD.org>2016-03-08 08:13:37 +0000
commitfcb5d99d476da42c3fc8fe7684c87ceb3a7110f1 (patch)
treedcdfe28c21fb521508612b6d54e290e84d654867
parent54eec7a19dd772dad64c0aafee6cad6981dc8910 (diff)
downloadFreeBSD-src-fcb5d99d476da42c3fc8fe7684c87ceb3a7110f1.zip
FreeBSD-src-fcb5d99d476da42c3fc8fe7684c87ceb3a7110f1.tar.gz
cxgbe(4): Remove __devinit and SPEED_<foo> as part of catch up with
internal shared code. Obtained from: Chelsio Communications
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c17
-rw-r--r--sys/dev/cxgbe/osdep.h12
-rw-r--r--sys/dev/cxgbe/t4_main.c8
3 files changed, 15 insertions, 22 deletions
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index bcdf33a..a878318 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -5359,7 +5359,7 @@ void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr,
*
* Initialize the congestion control parameters.
*/
-static void __devinit init_cong_ctrl(unsigned short *a, unsigned short *b)
+static void init_cong_ctrl(unsigned short *a, unsigned short *b)
{
a[0] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = 1;
a[9] = 2;
@@ -7400,13 +7400,13 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
if (stat & F_FW_PORT_CMD_TXPAUSE)
fc |= PAUSE_TX;
if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100M))
- speed = SPEED_100;
+ speed = 100;
else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_1G))
- speed = SPEED_1000;
+ speed = 1000;
else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G))
- speed = SPEED_10000;
+ speed = 10000;
else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G))
- speed = SPEED_40000;
+ speed = 40000;
for_each_port(adap, i) {
pi = adap2pinfo(adap, i);
@@ -7450,7 +7450,7 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
* Determines a card's PCI mode and associated parameters, such as speed
* and width.
*/
-static void __devinit get_pci_mode(struct adapter *adapter,
+static void get_pci_mode(struct adapter *adapter,
struct pci_params *p)
{
u16 val;
@@ -7472,8 +7472,7 @@ static void __devinit get_pci_mode(struct adapter *adapter,
* Initializes the SW state maintained for each link, including the link's
* capabilities and default speed/flow-control/autonegotiation settings.
*/
-static void __devinit init_link_config(struct link_config *lc,
- unsigned int caps)
+static void init_link_config(struct link_config *lc, unsigned int caps)
{
lc->supported = caps;
lc->requested_speed = 0;
@@ -7546,7 +7545,7 @@ int t4_get_flash_params(struct adapter *adapter)
return 0;
}
-static void __devinit set_pcie_completion_timeout(struct adapter *adapter,
+static void set_pcie_completion_timeout(struct adapter *adapter,
u8 range)
{
u16 val;
diff --git a/sys/dev/cxgbe/osdep.h b/sys/dev/cxgbe/osdep.h
index cc12da3..6fd704b 100644
--- a/sys/dev/cxgbe/osdep.h
+++ b/sys/dev/cxgbe/osdep.h
@@ -85,16 +85,15 @@ typedef boolean_t bool;
#define mdelay(x) DELAY((x) * 1000)
#define udelay(x) DELAY(x)
-#define __devinit
#define simple_strtoul strtoul
#define DIV_ROUND_UP(x, y) howmany(x, y)
#define ARRAY_SIZE(x) nitems(x)
#define container_of(p, s, f) ((s *)(((uint8_t *)(p)) - offsetof(s, f)))
-#define swab16(x) bswap16(x)
-#define swab32(x) bswap32(x)
-#define swab64(x) bswap64(x)
+#define swab16(x) bswap16(x)
+#define swab32(x) bswap32(x)
+#define swab64(x) bswap64(x)
#define le16_to_cpu(x) le16toh(x)
#define le32_to_cpu(x) le32toh(x)
#define le64_to_cpu(x) le64toh(x)
@@ -108,11 +107,6 @@ typedef boolean_t bool;
#define cpu_to_be32(x) htobe32(x)
#define cpu_to_be64(x) htobe64(x)
-#define SPEED_10 10
-#define SPEED_100 100
-#define SPEED_1000 1000
-#define SPEED_10000 10000
-#define SPEED_40000 40000
#define DUPLEX_HALF 0
#define DUPLEX_FULL 1
#define AUTONEG_DISABLE 0
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index a29a751..a4dd431 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -1783,13 +1783,13 @@ cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
return;
ifmr->ifm_active = IFM_ETHER | IFM_FDX;
- if (speed == SPEED_10000)
+ if (speed == 10000)
ifmr->ifm_active |= IFM_10G_T;
- else if (speed == SPEED_1000)
+ else if (speed == 1000)
ifmr->ifm_active |= IFM_1000_T;
- else if (speed == SPEED_100)
+ else if (speed == 100)
ifmr->ifm_active |= IFM_100_TX;
- else if (speed == SPEED_10)
+ else if (speed == 10)
ifmr->ifm_active |= IFM_10_T;
else
KASSERT(0, ("%s: link up but speed unknown (%u)", __func__,
OpenPOWER on IntegriCloud