Lines 147-153
Link Here
|
147 |
static funcptr ndis_linksts_wrap; |
147 |
static funcptr ndis_linksts_wrap; |
148 |
static funcptr ndis_linksts_done_wrap; |
148 |
static funcptr ndis_linksts_done_wrap; |
149 |
static funcptr ndis_ticktask_wrap; |
149 |
static funcptr ndis_ticktask_wrap; |
150 |
static funcptr ndis_starttask_wrap; |
150 |
static funcptr ndis_ifstarttask_wrap; |
151 |
static funcptr ndis_resettask_wrap; |
151 |
static funcptr ndis_resettask_wrap; |
152 |
static funcptr ndis_inputtask_wrap; |
152 |
static funcptr ndis_inputtask_wrap; |
153 |
|
153 |
|
Lines 162-172
Link Here
|
162 |
const struct ieee80211_bpf_params *); |
162 |
const struct ieee80211_bpf_params *); |
163 |
static void ndis_update_mcast (struct ieee80211com *); |
163 |
static void ndis_update_mcast (struct ieee80211com *); |
164 |
static void ndis_update_promisc (struct ieee80211com *); |
164 |
static void ndis_update_promisc (struct ieee80211com *); |
165 |
static void ndis_start (struct ifnet *); |
165 |
static void ndis_ifstart (struct ifnet *); |
166 |
static void ndis_starttask (device_object *, void *); |
166 |
static void ndis_ifstarttask (device_object *, void *); |
167 |
static void ndis_resettask (device_object *, void *); |
167 |
static void ndis_resettask (device_object *, void *); |
168 |
static void ndis_inputtask (device_object *, void *); |
168 |
static void ndis_inputtask (device_object *, void *); |
169 |
static int ndis_ioctl (struct ifnet *, u_long, caddr_t); |
169 |
static int ndis_ifioctl (struct ifnet *, u_long, caddr_t); |
170 |
static int ndis_newstate (struct ieee80211vap *, enum ieee80211_state, |
170 |
static int ndis_newstate (struct ieee80211vap *, enum ieee80211_state, |
171 |
int); |
171 |
int); |
172 |
static int ndis_nettype_chan (uint32_t); |
172 |
static int ndis_nettype_chan (uint32_t); |
Lines 246-252
Link Here
|
246 |
&ndis_linksts_done_wrap, 1, WINDRV_WRAP_STDCALL); |
246 |
&ndis_linksts_done_wrap, 1, WINDRV_WRAP_STDCALL); |
247 |
windrv_wrap((funcptr)ndis_ticktask, &ndis_ticktask_wrap, |
247 |
windrv_wrap((funcptr)ndis_ticktask, &ndis_ticktask_wrap, |
248 |
2, WINDRV_WRAP_STDCALL); |
248 |
2, WINDRV_WRAP_STDCALL); |
249 |
windrv_wrap((funcptr)ndis_starttask, &ndis_starttask_wrap, |
249 |
windrv_wrap((funcptr)ndis_ifstarttask, &ndis_ifstarttask_wrap, |
250 |
2, WINDRV_WRAP_STDCALL); |
250 |
2, WINDRV_WRAP_STDCALL); |
251 |
windrv_wrap((funcptr)ndis_resettask, &ndis_resettask_wrap, |
251 |
windrv_wrap((funcptr)ndis_resettask, &ndis_resettask_wrap, |
252 |
2, WINDRV_WRAP_STDCALL); |
252 |
2, WINDRV_WRAP_STDCALL); |
Lines 268-274
Link Here
|
268 |
windrv_unwrap(ndis_linksts_wrap); |
268 |
windrv_unwrap(ndis_linksts_wrap); |
269 |
windrv_unwrap(ndis_linksts_done_wrap); |
269 |
windrv_unwrap(ndis_linksts_done_wrap); |
270 |
windrv_unwrap(ndis_ticktask_wrap); |
270 |
windrv_unwrap(ndis_ticktask_wrap); |
271 |
windrv_unwrap(ndis_starttask_wrap); |
271 |
windrv_unwrap(ndis_ifstarttask_wrap); |
272 |
windrv_unwrap(ndis_resettask_wrap); |
272 |
windrv_unwrap(ndis_resettask_wrap); |
273 |
windrv_unwrap(ndis_inputtask_wrap); |
273 |
windrv_unwrap(ndis_inputtask_wrap); |
274 |
break; |
274 |
break; |
Lines 292-302
Link Here
|
292 |
int len, mclistsz, error; |
292 |
int len, mclistsz, error; |
293 |
uint8_t *mclist; |
293 |
uint8_t *mclist; |
294 |
|
294 |
|
295 |
ifp = sc->ifp; |
|
|
296 |
|
295 |
|
297 |
if (!NDIS_INITIALIZED(sc)) |
296 |
if (!NDIS_INITIALIZED(sc)) |
298 |
return; |
297 |
return; |
299 |
|
298 |
|
|
|
299 |
if (sc->ndis_80211) |
300 |
return; |
301 |
|
302 |
ifp = sc->ifp; |
300 |
if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { |
303 |
if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { |
301 |
sc->ndis_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; |
304 |
sc->ndis_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; |
302 |
len = sizeof(sc->ndis_filter); |
305 |
len = sizeof(sc->ndis_filter); |
Lines 368-380
Link Here
|
368 |
struct ifnet *ifp; |
375 |
struct ifnet *ifp; |
369 |
int len, error; |
376 |
int len, error; |
370 |
|
377 |
|
371 |
ifp = sc->ifp; |
|
|
372 |
|
373 |
if (!NDIS_INITIALIZED(sc)) |
378 |
if (!NDIS_INITIALIZED(sc)) |
374 |
return (EINVAL); |
379 |
return (EINVAL); |
375 |
|
380 |
|
|
|
381 |
if (sc->ndis_80211) |
382 |
return (EINVAL); |
376 |
/* See if there's anything to set. */ |
383 |
/* See if there's anything to set. */ |
377 |
|
384 |
|
|
|
385 |
ifp = sc->ifp; |
378 |
error = ndis_probe_offload(sc); |
386 |
error = ndis_probe_offload(sc); |
379 |
if (error) |
387 |
if (error) |
380 |
return (error); |
388 |
return (error); |
Lines 965-972
Link Here
|
965 |
if_initname(ifp, device_get_name(sc->ndis_dev), |
999 |
if_initname(ifp, device_get_name(sc->ndis_dev), |
966 |
device_get_unit(sc->ndis_dev)); |
1000 |
device_get_unit(sc->ndis_dev)); |
967 |
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; |
1001 |
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; |
968 |
ifp->if_ioctl = ndis_ioctl; |
1002 |
ifp->if_ioctl = ndis_ifioctl; |
969 |
ifp->if_start = ndis_start; |
1003 |
ifp->if_start = ndis_ifstart; |
970 |
ifp->if_init = ndis_init; |
1004 |
ifp->if_init = ndis_init; |
971 |
ifp->if_baudrate = 10000000; |
1005 |
ifp->if_baudrate = 10000000; |
972 |
IFQ_SET_MAXLEN(&ifp->if_snd, 50); |
1006 |
IFQ_SET_MAXLEN(&ifp->if_snd, 50); |
Lines 1560-1578
Link Here
|
1560 |
sc->ndis_txarray[idx] = NULL; |
1584 |
sc->ndis_txarray[idx] = NULL; |
1561 |
sc->ndis_txpending++; |
1585 |
sc->ndis_txpending++; |
1562 |
|
1586 |
|
1563 |
if (status == NDIS_STATUS_SUCCESS) |
1587 |
if (!sc->ndis_80211) { |
1564 |
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); |
1588 |
struct ifnet *ifp = sc->ifp; |
1565 |
else |
1589 |
if (status == NDIS_STATUS_SUCCESS) |
1566 |
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); |
1590 |
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); |
1567 |
|
1591 |
else |
|
|
1592 |
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); |
1593 |
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; |
1594 |
} |
1568 |
sc->ndis_tx_timer = 0; |
1595 |
sc->ndis_tx_timer = 0; |
1569 |
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; |
|
|
1570 |
|
1596 |
|
1571 |
NDIS_UNLOCK(sc); |
1597 |
NDIS_UNLOCK(sc); |
1572 |
|
1598 |
|
1573 |
IoQueueWorkItem(sc->ndis_startitem, |
1599 |
if (!sc->ndis_80211) |
1574 |
(io_workitem_func)ndis_starttask_wrap, |
1600 |
IoQueueWorkItem(sc->ndis_startitem, |
1575 |
WORKQUEUE_CRITICAL, ifp); |
1601 |
(io_workitem_func)ndis_ifstarttask_wrap, |
|
|
1602 |
WORKQUEUE_CRITICAL, sc); |
1603 |
DPRINTF(("%s: ndis_ifstarttask_wrap sc=%p\n", __func__, sc)); |
1576 |
} |
1604 |
} |
1577 |
|
1605 |
|
1578 |
static void |
1606 |
static void |
Lines 1635-1643
Link Here
|
1635 |
IoQueueWorkItem(sc->ndis_tickitem, |
1671 |
IoQueueWorkItem(sc->ndis_tickitem, |
1636 |
(io_workitem_func)ndis_ticktask_wrap, |
1672 |
(io_workitem_func)ndis_ticktask_wrap, |
1637 |
WORKQUEUE_CRITICAL, sc); |
1673 |
WORKQUEUE_CRITICAL, sc); |
1638 |
IoQueueWorkItem(sc->ndis_startitem, |
1674 |
if (!sc->ndis_80211) |
1639 |
(io_workitem_func)ndis_starttask_wrap, |
1675 |
IoQueueWorkItem(sc->ndis_startitem, |
1640 |
WORKQUEUE_CRITICAL, ifp); |
1676 |
(io_workitem_func)ndis_ifstarttask_wrap, |
|
|
1677 |
WORKQUEUE_CRITICAL, sc); |
1641 |
break; |
1678 |
break; |
1642 |
case NDIS_STATUS_MEDIA_DISCONNECT: |
1679 |
case NDIS_STATUS_MEDIA_DISCONNECT: |
1643 |
if (sc->ndis_link) |
1680 |
if (sc->ndis_link) |
Lines 1672-1680
Link Here
|
1672 |
IoQueueWorkItem(sc->ndis_resetitem, |
1709 |
IoQueueWorkItem(sc->ndis_resetitem, |
1673 |
(io_workitem_func)ndis_resettask_wrap, |
1710 |
(io_workitem_func)ndis_resettask_wrap, |
1674 |
WORKQUEUE_CRITICAL, sc); |
1711 |
WORKQUEUE_CRITICAL, sc); |
1675 |
IoQueueWorkItem(sc->ndis_startitem, |
1712 |
if (!sc->ndis_80211) |
1676 |
(io_workitem_func)ndis_starttask_wrap, |
1713 |
IoQueueWorkItem(sc->ndis_startitem, |
1677 |
WORKQUEUE_CRITICAL, sc->ifp); |
1714 |
(io_workitem_func)ndis_ifstarttask_wrap, |
|
|
1715 |
WORKQUEUE_CRITICAL, sc); |
1678 |
} |
1716 |
} |
1679 |
|
1717 |
|
1680 |
callout_reset(&sc->ndis_stat_callout, hz, ndis_tick, sc); |
1718 |
callout_reset(&sc->ndis_stat_callout, hz, ndis_tick, sc); |
Lines 1796-1811
Link Here
|
1796 |
} |
1834 |
} |
1797 |
|
1835 |
|
1798 |
static void |
1836 |
static void |
1799 |
ndis_starttask(d, arg) |
1837 |
ndis_ifstarttask(device_object *d, void *arg) |
1800 |
device_object *d; |
|
|
1801 |
void *arg; |
1802 |
{ |
1838 |
{ |
1803 |
struct ifnet *ifp; |
1839 |
struct ndis_softc *sc = arg; |
|
|
1840 |
DPRINTF(("%s: sc=%p, ifp=%p\n", __func__, sc, sc->ifp)); |
1841 |
if (sc->ndis_80211) |
1842 |
return; |
1804 |
|
1843 |
|
1805 |
ifp = arg; |
1844 |
struct ifnet *ifp = sc->ifp; |
1806 |
|
|
|
1807 |
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) |
1845 |
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) |
1808 |
ndis_start(ifp); |
1846 |
ndis_ifstart(ifp); |
1809 |
} |
1847 |
} |
1810 |
|
1848 |
|
1811 |
/* |
1849 |
/* |
Lines 1821-1826
Link Here
|
1821 |
* will do the mapping themselves on a buffer by buffer basis. |
1859 |
* will do the mapping themselves on a buffer by buffer basis. |
1822 |
*/ |
1860 |
*/ |
1823 |
static void |
1861 |
static void |
1824 |
ndis_start(ifp) |
1862 |
ndis_ifstart(struct ifnet *ifp) |
1825 |
struct ifnet *ifp; |
|
|
1826 |
{ |
1863 |
{ |
Lines 2880-2886
Link Here
|
2880 |
} |
2928 |
} |
2881 |
|
2929 |
|
2882 |
static int |
2930 |
static int |
2883 |
ndis_ioctl(ifp, command, data) |
2931 |
ndis_ifioctl(ifp, command, data) |
2884 |
struct ifnet *ifp; |
2932 |
struct ifnet *ifp; |
2885 |
u_long command; |
2933 |
u_long command; |
2886 |
caddr_t data; |
2934 |
caddr_t data; |