summaryrefslogtreecommitdiffstats
path: root/sys/dev/ral/rt2560.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ral/rt2560.c')
-rw-r--r--sys/dev/ral/rt2560.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index 1536a35..17a7201 100644
--- a/sys/dev/ral/rt2560.c
+++ b/sys/dev/ral/rt2560.c
@@ -2005,9 +2005,9 @@ rt2560_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct ifreq *ifr = (struct ifreq *) data;
int error = 0, startall = 0;
- RAL_LOCK(sc);
switch (cmd) {
case SIOCSIFFLAGS:
+ RAL_LOCK(sc);
if (ifp->if_flags & IFF_UP) {
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
rt2560_init_locked(sc);
@@ -2018,19 +2018,20 @@ rt2560_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
rt2560_stop_locked(sc);
}
+ RAL_UNLOCK(sc);
+ if (startall)
+ ieee80211_start_all(ic);
break;
case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd);
break;
- default:
+ case SIOCGIFADDR:
error = ether_ioctl(ifp, cmd, data);
break;
+ default:
+ error = EINVAL;
+ break;
}
- RAL_UNLOCK(sc);
-
- if (startall)
- ieee80211_start_all(ic);
return error;
}
OpenPOWER on IntegriCloud