diff options
author | Robert Mustacchi <rm@joyent.com> | 2017-07-01 01:27:06 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2017-07-03 17:21:03 +0000 |
commit | 75647a92265dde475f2caca5f9d959ecf9f8b633 (patch) | |
tree | ca6bbec932f127fbd747e593dda6fe58aa8b3c07 | |
parent | 1a8b5e84e7fce7cfa38f205cdb03ffd82f019af2 (diff) | |
download | illumos-joyent-75647a92265dde475f2caca5f9d959ecf9f8b633.tar.gz |
OS-6219 Temporarily revert cxgbe MAC_CAPAB_TRANSCEIVER support
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Patrick Mooney <patrick.mooney@joyent.com>
-rw-r--r-- | usr/src/uts/common/io/cxgbe/common/common.h | 2 | ||||
-rw-r--r-- | usr/src/uts/common/io/cxgbe/common/t4_hw.c | 43 | ||||
-rw-r--r-- | usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c | 77 |
3 files changed, 0 insertions, 122 deletions
diff --git a/usr/src/uts/common/io/cxgbe/common/common.h b/usr/src/uts/common/io/cxgbe/common/common.h index 9379864078..09e67b14b5 100644 --- a/usr/src/uts/common/io/cxgbe/common/common.h +++ b/usr/src/uts/common/io/cxgbe/common/common.h @@ -503,8 +503,6 @@ int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, unsigned int mmd, unsigned int reg, unsigned int *valp); int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, unsigned int mmd, unsigned int reg, unsigned int val); -int t4_i2c_rd(struct adapter *adap, unsigned int mbox, int port, - unsigned int devid, unsigned int offset, unsigned int len, u8 *buf); int t4_iq_start_stop(struct adapter *adap, unsigned int mbox, bool start, unsigned int pf, unsigned int vf, unsigned int iqid, unsigned int fl0id, unsigned int fl1id); diff --git a/usr/src/uts/common/io/cxgbe/common/t4_hw.c b/usr/src/uts/common/io/cxgbe/common/t4_hw.c index eee6b7de84..e4182ace29 100644 --- a/usr/src/uts/common/io/cxgbe/common/t4_hw.c +++ b/usr/src/uts/common/io/cxgbe/common/t4_hw.c @@ -3914,49 +3914,6 @@ t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, } /* - * t4_i2c_rd - read I2C data from adapter - * @adap: the adapter - * @port: Port number if per-port device; <0 if not - * @devid: per-port device ID or absolute device ID - * @offset: byte offset into device I2C space - * @len: byte length of I2C space data - * @buf: buffer in which to return I2C data - * - * Reads the I2C data from the indicated device and location. - */ -int -t4_i2c_rd(struct adapter *adap, unsigned int mbox, int port, unsigned int devid, - unsigned int offset, unsigned int len, u8 *buf) -{ - u32 ldst_addrspace; - struct fw_ldst_cmd ldst; - int ret; - - if (port >= 4 || - devid >= 256 || - offset >= 256 || - len > sizeof ldst.u.i2c.data) - return -EINVAL; - - memset(&ldst, 0, sizeof ldst); - ldst_addrspace = V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_I2C); - ldst.op_to_addrspace = - cpu_to_be32(V_FW_CMD_OP(FW_LDST_CMD) | - F_FW_CMD_REQUEST | - F_FW_CMD_READ | - ldst_addrspace); - ldst.cycles_to_len16 = cpu_to_be32(FW_LEN16(ldst)); - ldst.u.i2c.pid = (port < 0 ? 0xff : port); - ldst.u.i2c.did = devid; - ldst.u.i2c.boffset = offset; - ldst.u.i2c.blen = len; - ret = t4_wr_mbox(adap, mbox, &ldst, sizeof ldst, &ldst); - if (!ret) - memcpy(buf, ldst.u.i2c.data, len); - return ret; -} - -/* * t4_sge_ctxt_rd - read an SGE context through FW * @adap: the adapter * @mbox: mailbox to use for the FW command diff --git a/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c b/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c index 1d2643286e..3ab0473fff 100644 --- a/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c +++ b/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c @@ -20,10 +20,6 @@ * release for licensing terms and conditions. */ -/* - * Copyright (c) 2017, Joyent, Inc. - */ - #include <sys/ddi.h> #include <sys/sunddi.h> #include <sys/dlpi.h> @@ -75,11 +71,6 @@ mac_callbacks_t t4_m_callbacks = { .mc_propinfo = t4_mc_propinfo, }; -/* - * Maximum size that we can read in a single command. - */ -#define T4_TRAN_MAXREAD 48 - #define T4PROP_TMR_IDX "_holdoff_timer_idx" #define T4PROP_PKTC_IDX "_holdoff_pktc_idx" #define T4PROP_MTU "_mtu" @@ -459,70 +450,11 @@ t4_mc_tx(void *arg, mblk_t *m) return (t4_eth_tx(pi, txq, m)); } -static int -t4_mc_transceiver_info(void *arg, uint_t id, mac_transceiver_info_t *infop) -{ - struct port_info *pi = arg; - - if (id != 0 || infop == NULL) - return (EINVAL); - - switch (pi->mod_type) { - case FW_PORT_MOD_TYPE_NONE: - mac_transceiver_info_set_present(infop, B_FALSE); - break; - case FW_PORT_MOD_TYPE_NOTSUPPORTED: - mac_transceiver_info_set_present(infop, B_TRUE); - mac_transceiver_info_set_usable(infop, B_FALSE); - break; - default: - mac_transceiver_info_set_present(infop, B_TRUE); - mac_transceiver_info_set_usable(infop, B_TRUE); - break; - } - - return (0); -} - -static int -t4_mc_transceiver_read(void *arg, uint_t id, uint_t page, void *bp, - size_t nbytes, off_t offset, size_t *nread) -{ - struct port_info *pi = arg; - struct adapter *sc = pi->adapter; - int rc; - size_t i; - - if (id != 0 || bp == NULL || nbytes == 0 || nread == NULL || - (page != 0xa0 && page != 0xa2) || offset < 0) - return (EINVAL); - - if (nbytes > 256 || offset >= 256 || (offset + nbytes > 256)) - return (EINVAL); - - rc = begin_synchronized_op(pi, 0, 1); - if (rc != 0) - return (rc); - for (i = 0; i < nbytes; i += T4_TRAN_MAXREAD) { - size_t toread = MIN(T4_TRAN_MAXREAD, nbytes - i); - rc = -t4_i2c_rd(sc, sc->mbox, pi->port_id, page, offset, toread, bp); - if (rc != 0) - break; - offset += toread; - bp = (void *)((uintptr_t)bp + toread); - } - end_synchronized_op(pi, 0); - if (rc == 0) - *nread = nbytes; - return (rc); -} - static boolean_t t4_mc_getcapab(void *arg, mac_capab_t cap, void *data) { struct port_info *pi = arg; boolean_t status = B_TRUE; - mac_capab_transceiver_t *mct; switch (cap) { case MAC_CAPAB_HCKSUM: @@ -545,15 +477,6 @@ t4_mc_getcapab(void *arg, mac_capab_t cap, void *data) status = B_FALSE; break; - case MAC_CAPAB_TRANSCEIVER: - mct = data; - - mct->mct_flags = 0; - mct->mct_ntransceivers = 1; - mct->mct_info = t4_mc_transceiver_info; - mct->mct_read = t4_mc_transceiver_read; - break; - default: status = B_FALSE; /* cap not supported */ } |