Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/qlnx/qlnxe/qlnx_os.c
| Show First 20 Lines • Show All 2,562 Lines • ▼ Show 20 Lines | qlnx_set_multi(qlnx_host_t *ha, uint32_t add_multi) | ||||
| if_t ifp = ha->ifp; | if_t ifp = ha->ifp; | ||||
| u_int mcnt; | u_int mcnt; | ||||
| if (qlnx_vf_device(ha) == 0) | if (qlnx_vf_device(ha) == 0) | ||||
| return (0); | return (0); | ||||
| mcnt = if_foreach_llmaddr(ifp, qlnx_copy_maddr, mta); | mcnt = if_foreach_llmaddr(ifp, qlnx_copy_maddr, mta); | ||||
| QLNX_LOCK(ha); | |||||
| qlnx_hw_set_multi(ha, mta, mcnt, add_multi); | qlnx_hw_set_multi(ha, mta, mcnt, add_multi); | ||||
| QLNX_UNLOCK(ha); | |||||
| return (0); | return (0); | ||||
| } | } | ||||
| static int | static int | ||||
| qlnx_set_promisc(qlnx_host_t *ha, int enabled) | qlnx_set_promisc(qlnx_host_t *ha, int enabled) | ||||
| { | { | ||||
| int rc = 0; | int rc = 0; | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | #endif | ||||
| switch (cmd) { | switch (cmd) { | ||||
| case SIOCSIFADDR: | case SIOCSIFADDR: | ||||
| QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx)\n", cmd); | QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx)\n", cmd); | ||||
| #ifdef INET | #ifdef INET | ||||
| if (ifa->ifa_addr->sa_family == AF_INET) { | if (ifa->ifa_addr->sa_family == AF_INET) { | ||||
| if_setflagbits(ifp, IFF_UP, 0); | if_setflagbits(ifp, IFF_UP, 0); | ||||
| if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) { | |||||
| QLNX_LOCK(ha); | QLNX_LOCK(ha); | ||||
| if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) | |||||
| qlnx_init_locked(ha); | qlnx_init_locked(ha); | ||||
| QLNX_UNLOCK(ha); | QLNX_UNLOCK(ha); | ||||
| } | |||||
| QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", | QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", | ||||
| cmd, ntohl(IA_SIN(ifa)->sin_addr.s_addr)); | cmd, ntohl(IA_SIN(ifa)->sin_addr.s_addr)); | ||||
| arp_ifinit(ifp, ifa); | arp_ifinit(ifp, ifa); | ||||
| break; | break; | ||||
| } | } | ||||
| #endif | #endif | ||||
| ether_ioctl(ifp, cmd, data); | ether_ioctl(ifp, cmd, data); | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | case SIOCSIFFLAGS: | ||||
| ha->if_flags = if_getflags(ifp); | ha->if_flags = if_getflags(ifp); | ||||
| QLNX_UNLOCK(ha); | QLNX_UNLOCK(ha); | ||||
| break; | break; | ||||
| case SIOCADDMULTI: | case SIOCADDMULTI: | ||||
| QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCADDMULTI", cmd); | QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCADDMULTI", cmd); | ||||
| if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { | QLNX_LOCK(ha); | ||||
| if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { | |||||
| if (qlnx_set_multi(ha, 1)) | if (qlnx_set_multi(ha, 1)) | ||||
| ret = EINVAL; | ret = EINVAL; | ||||
| } | } | ||||
| QLNX_UNLOCK(ha); | |||||
| break; | break; | ||||
| case SIOCDELMULTI: | case SIOCDELMULTI: | ||||
| QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCDELMULTI", cmd); | QL_DPRINT4(ha, "%s (0x%lx)\n", "SIOCDELMULTI", cmd); | ||||
| if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { | QLNX_LOCK(ha); | ||||
| if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { | |||||
| if (qlnx_set_multi(ha, 0)) | if (qlnx_set_multi(ha, 0)) | ||||
| ret = EINVAL; | ret = EINVAL; | ||||
| } | } | ||||
| QLNX_UNLOCK(ha); | |||||
| break; | break; | ||||
| case SIOCSIFMEDIA: | case SIOCSIFMEDIA: | ||||
| case SIOCGIFMEDIA: | case SIOCGIFMEDIA: | ||||
| case SIOCGIFXMEDIA: | case SIOCGIFXMEDIA: | ||||
| QL_DPRINT4(ha, | QL_DPRINT4(ha, | ||||
| "SIOCSIFMEDIA/SIOCGIFMEDIA/SIOCGIFXMEDIA (0x%lx)\n", cmd); | "SIOCSIFMEDIA/SIOCGIFMEDIA/SIOCGIFXMEDIA (0x%lx)\n", cmd); | ||||
| ▲ Show 20 Lines • Show All 5,621 Lines • Show Last 20 Lines | |||||