Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/qlnx/qlnxe/qlnx_os.c
| Show All 24 Lines | |||||
| * POSSIBILITY OF SUCH DAMAGE. | * POSSIBILITY OF SUCH DAMAGE. | ||||
| */ | */ | ||||
| /* | /* | ||||
| * File: qlnx_os.c | * File: qlnx_os.c | ||||
| * Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131. | * Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131. | ||||
| */ | */ | ||||
| #include "opt_inet.h" | |||||
| #include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
| #include "qlnx_os.h" | #include "qlnx_os.h" | ||||
| #include "bcm_osal.h" | #include "bcm_osal.h" | ||||
| #include "reg_addr.h" | #include "reg_addr.h" | ||||
| #include "ecore_gtt_reg_addr.h" | #include "ecore_gtt_reg_addr.h" | ||||
| #include "ecore.h" | #include "ecore.h" | ||||
| #include "ecore_chain.h" | #include "ecore_chain.h" | ||||
| #include "ecore_status.h" | #include "ecore_status.h" | ||||
| ▲ Show 20 Lines • Show All 2,574 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static int | static int | ||||
| qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) | qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) | ||||
| { | { | ||||
| int ret = 0, mask; | int ret = 0, mask; | ||||
| int flags; | int flags; | ||||
| struct ifreq *ifr = (struct ifreq *)data; | struct ifreq *ifr = (struct ifreq *)data; | ||||
| #ifdef INET | |||||
| struct ifaddr *ifa = (struct ifaddr *)data; | |||||
| #endif | |||||
| qlnx_host_t *ha; | qlnx_host_t *ha; | ||||
| ha = (qlnx_host_t *)if_getsoftc(ifp); | ha = (qlnx_host_t *)if_getsoftc(ifp); | ||||
| switch (cmd) { | switch (cmd) { | ||||
| case SIOCSIFADDR: | |||||
| QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx)\n", cmd); | |||||
| #ifdef INET | |||||
| if (ifa->ifa_addr->sa_family == AF_INET) { | |||||
| if_setflagbits(ifp, IFF_UP, 0); | |||||
| QLNX_LOCK(ha); | |||||
| if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) | |||||
| qlnx_init_locked(ha); | |||||
| QLNX_UNLOCK(ha); | |||||
| QL_DPRINT4(ha, "SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", | |||||
| cmd, ntohl(IA_SIN(ifa)->sin_addr.s_addr)); | |||||
| arp_ifinit(ifp, ifa); | |||||
| break; | |||||
| } | |||||
| #endif | |||||
| ether_ioctl(ifp, cmd, data); | |||||
| break; | |||||
| case SIOCSIFMTU: | case SIOCSIFMTU: | ||||
| QL_DPRINT4(ha, "SIOCSIFMTU (0x%lx)\n", cmd); | QL_DPRINT4(ha, "SIOCSIFMTU (0x%lx)\n", cmd); | ||||
| if (ifr->ifr_mtu > QLNX_MAX_MTU) { | if (ifr->ifr_mtu > QLNX_MAX_MTU) { | ||||
| ret = EINVAL; | ret = EINVAL; | ||||
| } else { | } else { | ||||
| QLNX_LOCK(ha); | QLNX_LOCK(ha); | ||||
| if_setmtu(ifp, ifr->ifr_mtu); | if_setmtu(ifp, ifr->ifr_mtu); | ||||
| ▲ Show 20 Lines • Show All 5,689 Lines • Show Last 20 Lines | |||||