aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid C Somayajulu <davidcs@FreeBSD.org>2016-05-10 03:04:14 +0000
committerDavid C Somayajulu <davidcs@FreeBSD.org>2016-05-10 03:04:14 +0000
commit3861aa4a836c012f23d0d4b606c5e83d3d4ef869 (patch)
treea5746e7beb355370340a12c538074a28cf2be0af
parentf5c6c7edd9ce06f680acdb24ae63e8c14ab9efd8 (diff)
downloadsrc-3861aa4a836c012f23d0d4b606c5e83d3d4ef869.tar.gz
src-3861aa4a836c012f23d0d4b606c5e83d3d4ef869.zip
MFC r298496
Remove Unused/Dead Code
Notes
Notes: svn path=/stable/8/; revision=299304
-rw-r--r--sys/dev/bxe/bxe.c141
1 files changed, 0 insertions, 141 deletions
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index 50f4c421102c..be5aa03c3f8b 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -4440,115 +4440,6 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr)
}
}
-static int
-bxe_ioctl_nvram(struct bxe_softc *sc,
- uint32_t priv_op,
- struct ifreq *ifr)
-{
- struct bxe_nvram_data nvdata_base;
- struct bxe_nvram_data *nvdata;
- int len;
- int error = 0;
-
- copyin(ifr->ifr_data, &nvdata_base, sizeof(nvdata_base));
-
- len = (sizeof(struct bxe_nvram_data) +
- nvdata_base.len -
- sizeof(uint32_t));
-
- if (len > sizeof(struct bxe_nvram_data)) {
- if ((nvdata = (struct bxe_nvram_data *)
- malloc(len, M_DEVBUF,
- (M_NOWAIT | M_ZERO))) == NULL) {
- BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x "
- " len = 0x%x\n", priv_op, len);
- return (1);
- }
- memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data));
- } else {
- nvdata = &nvdata_base;
- }
-
- if (priv_op == BXE_IOC_RD_NVRAM) {
- BLOGD(sc, DBG_IOCTL, "IOC_RD_NVRAM 0x%x %d\n",
- nvdata->offset, nvdata->len);
- error = bxe_nvram_read(sc,
- nvdata->offset,
- (uint8_t *)nvdata->value,
- nvdata->len);
- copyout(nvdata, ifr->ifr_data, len);
- } else { /* BXE_IOC_WR_NVRAM */
- BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n",
- nvdata->offset, nvdata->len);
- copyin(ifr->ifr_data, nvdata, len);
- error = bxe_nvram_write(sc,
- nvdata->offset,
- (uint8_t *)nvdata->value,
- nvdata->len);
- }
-
- if (len > sizeof(struct bxe_nvram_data)) {
- free(nvdata, M_DEVBUF);
- }
-
- return (error);
-}
-
-static int
-bxe_ioctl_stats_show(struct bxe_softc *sc,
- uint32_t priv_op,
- struct ifreq *ifr)
-{
- const size_t str_size = (BXE_NUM_ETH_STATS * STAT_NAME_LEN);
- const size_t stats_size = (BXE_NUM_ETH_STATS * sizeof(uint64_t));
- caddr_t p_tmp;
- uint32_t *offset;
- int i;
-
- switch (priv_op)
- {
- case BXE_IOC_STATS_SHOW_NUM:
- memset(ifr->ifr_data, 0, sizeof(union bxe_stats_show_data));
- ((union bxe_stats_show_data *)ifr->ifr_data)->desc.num =
- BXE_NUM_ETH_STATS;
- ((union bxe_stats_show_data *)ifr->ifr_data)->desc.len =
- STAT_NAME_LEN;
- return (0);
-
- case BXE_IOC_STATS_SHOW_STR:
- memset(ifr->ifr_data, 0, str_size);
- p_tmp = ifr->ifr_data;
- for (i = 0; i < BXE_NUM_ETH_STATS; i++) {
- strcpy(p_tmp, bxe_eth_stats_arr[i].string);
- p_tmp += STAT_NAME_LEN;
- }
- return (0);
-
- case BXE_IOC_STATS_SHOW_CNT:
- memset(ifr->ifr_data, 0, stats_size);
- p_tmp = ifr->ifr_data;
- for (i = 0; i < BXE_NUM_ETH_STATS; i++) {
- offset = ((uint32_t *)&sc->eth_stats +
- bxe_eth_stats_arr[i].offset);
- switch (bxe_eth_stats_arr[i].size) {
- case 4:
- *((uint64_t *)p_tmp) = (uint64_t)*offset;
- break;
- case 8:
- *((uint64_t *)p_tmp) = HILO_U64(*offset, *(offset + 1));
- break;
- default:
- *((uint64_t *)p_tmp) = 0;
- }
- p_tmp += sizeof(uint64_t);
- }
- return (0);
-
- default:
- return (-1);
- }
-}
-
static void
bxe_handle_chip_tq(void *context,
int pending)
@@ -4588,8 +4479,6 @@ bxe_ioctl(struct ifnet *ifp,
{
struct bxe_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)data;
- struct bxe_nvram_data *nvdata;
- uint32_t priv_op;
int mask = 0;
int reinit = 0;
int error = 0;
@@ -4774,36 +4663,6 @@ bxe_ioctl(struct ifnet *ifp,
error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
break;
- case SIOCGPRIVATE_0:
- copyin(ifr->ifr_data, &priv_op, sizeof(priv_op));
-
- switch (priv_op)
- {
- case BXE_IOC_RD_NVRAM:
- case BXE_IOC_WR_NVRAM:
- nvdata = (struct bxe_nvram_data *)ifr->ifr_data;
- BLOGD(sc, DBG_IOCTL,
- "Received Private NVRAM ioctl addr=0x%x size=%u\n",
- nvdata->offset, nvdata->len);
- error = bxe_ioctl_nvram(sc, priv_op, ifr);
- break;
-
- case BXE_IOC_STATS_SHOW_NUM:
- case BXE_IOC_STATS_SHOW_STR:
- case BXE_IOC_STATS_SHOW_CNT:
- BLOGD(sc, DBG_IOCTL, "Received Private Stats ioctl (%d)\n",
- priv_op);
- error = bxe_ioctl_stats_show(sc, priv_op, ifr);
- break;
-
- default:
- BLOGW(sc, "Received Private Unknown ioctl (%d)\n", priv_op);
- error = EINVAL;
- break;
- }
-
- break;
-
default:
BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n",
(command & 0xff));