Name Date Size #Lines LOC

..--

wlan/H--43,50731,396

wlan_acl/H--371278

wlan_amrr/H--85

wlan_ccmp/H--668439

wlan_rssadapt/H--105

wlan_tkip/H--1,024752

wlan_wep/H--513364

wlan_xauth/H--9136

MakefileH A D11-Nov-2017120 53

README.DRAGONFLYH A D09-Dec-20234.9 KiB150109

_ieee80211.hH A D31-Dec-202017.7 KiB453297

dofbsddiffH A D25-May-2015398 2217

ieee80211.hH A D05-May-202046.5 KiB1,393974

ieee80211_action.hH A D11-Jan-20152.2 KiB5319

ieee80211_adhoc.hH A D11-Jan-20151.6 KiB365

ieee80211_ageq.hH A D11-Jan-20152.3 KiB5525

ieee80211_alq.hH A D11-Jan-20152 KiB5414

ieee80211_amrr.hH A D11-Jan-20151.9 KiB6221

ieee80211_crypto.hH A D20-Oct-20199.8 KiB254150

ieee80211_dfs.hH A D11-Jan-20152.5 KiB6427

ieee80211_dragonfly.hH A D02-Apr-202424.9 KiB689496

ieee80211_hostap.hH A D11-Jan-20151.7 KiB426

ieee80211_ht.hH A D12-May-20168.3 KiB226147

ieee80211_input.hH A D14-Mar-20218.6 KiB266160

ieee80211_ioctl.hH A D12-May-201636.7 KiB866573

ieee80211_mesh.hH A D20-Oct-201919.6 KiB608420

ieee80211_monitor.hH A D11-Jan-20151.6 KiB365

ieee80211_node.hH A D20-Oct-201920.1 KiB473344

ieee80211_phy.hH A D12-May-20166.6 KiB21196

ieee80211_power.hH A D11-Jan-20153.4 KiB8834

ieee80211_proto.hH A D12-May-201617.7 KiB449327

ieee80211_radiotap.hH A D11-Jan-20159.7 KiB25468

ieee80211_ratectl.hH A D20-Oct-20194.1 KiB13187

ieee80211_regdomain.hH A D11-Jan-201510.4 KiB294238

ieee80211_rssadapt.hH A D11-Jan-20152.9 KiB7225

ieee80211_scan.hH A D20-Oct-201914.6 KiB350219

ieee80211_scan_sw.hH A D04-Jan-20161.5 KiB334

ieee80211_sta.hH A D11-Jan-20151.8 KiB438

ieee80211_superg.hH A D12-May-20165.5 KiB16093

ieee80211_tdma.hH A D04-Jan-20164 KiB10455

ieee80211_var.hH A D20-Oct-201943.9 KiB1,039768

ieee80211_wds.hH A D11-Jan-20151.8 KiB408

ieee80211_wps.hH A D05-May-20206.7 KiB150110

README.DRAGONFLY

1
2			    README.DRAGONFLY
3
4		Porting low level drivers from FreeBSD
5
6    * Fixup #include lines.
7
8      <dev/pci/blah.h>  -> <bus/pci/blah.h>
9      <dev/blah/blah.h> -> <dev/netif/blah/blah.h>
10      <net80211/blah.h> -> <netproto/802_11/blah.h>
11
12      remove <machine/bus.h>
13      remove <machine/resource.h>
14      add    <net/ifq_var.h>
15
16    * Simple API changes
17
18      malloc	   -> kmalloc
19      free	   -> kfree
20      printf	   -> kprintf
21      pci_find_cap -> pci_find_extcap
22
23      In kmalloc calls, M_NOWAIT -> M_INTWAIT
24
25    * mbuf related calls
26
27      m_collapse(m, M_NOWAIT, blah)	->	m_defrag(m, M_NOWAIT)
28
29      bus_dmamap_load_mbuf_sg(dmat, map, m, segs, &nsegs, BUS_DMA_NOWAIT) ->
30	bus_dmamap_load_mbuf_segment(dmat, map, m, segs, maxscatter,
31					&nsegs, BUS_DMA_NOWAIT);
32
33	The maxscatter argument depends on the driver, '1' if you do not
34	know.
35
36    * netif interface
37
38      IFQ_SET_MAXLEN(), ifp->if_snd.ifq_drv_maxlen = blah, IFQ_SET_READY() ->
39	ifq_set_maxlen(&ifp->if_snd, blah)
40
41      if_start() and if_ioctl() have an additional argument.
42
43	  void blah_start(struct ifnet *, struct ifaltq_subque *);
44	  int  blah_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *);
45
46	  In this situation the additional argument can usually be ignored.
47
48      if_inc_counter(ifp, IFCOUNTER_BLAH, 1)	-> IFNET_STAT_INC(ifp, blah, 1)
49      if_inc_counter(ifp, IFCOUNTER_OERRORS, 1) -> IFNET_STAT_INC(ifp, oerrors, 1)
50
51      if_drv_flags used with IFF_DRV_RUNNING   ->
52      if_flags used with IFF_RUNNING
53
54      if_drv_flags used with IFF_DRV_OACTIVE  ->
55      ifq_is_oactive(), ifq_set_oactive(), ifq_clr_oactive() as appropriate.
56
57      Be very careful here, review your patches to make sure you aren't
58      testing the wrong field against the IFF_* macro.  All OACTIVE chanages
59      must use our API calls and not test the flag(s) directly.
60
61    * Change all struct mtx and related locking api calls and macros
62      to use struct lock (lockmgr locks).
63
64      struct mtx	->	struct lock
65
66      lockmgr(lk, LK_EXCUSIVE)
67      lockmgr(lk, LK_RELEASE)
68      lockinit(lk, wmesg, 0, flags)		(typically 0 or LK_CANRECURSE)
69      KKASSERT(lockstatus(lk) == LK_EXCUSIVE)	(asserting held)
70      KKASSERT(lockstatus(lk) != LK_EXCUSIVE)	(asserting not held)
71
72    * msleep() calls typically have to become lksleep() calls.  However,
73      in these situations the wlan_global_serializer might also be held
74      and must be released, so it is best to wrap it in your own blahsleep()
75      function which does this in addition to the lksleep():
76
77	blah_sleep(struct blah_softc *sc, void *wchan,
78		   int flags, const char *wmsg, int timo)
79	{
80		int iws;
81		int error;
82
83		iws = wlan_is_serialized()
84		if (iws)
85			wlan_serialize_exit();
86		error = lksleep(wchan, appropriatelock, flags, wmsg, timo);
87		if (iws)
88			wlan_serialize_enter();
89		return error;
90	}
91
92    * Firmware loading and/or the general network init function may have
93      to release wlan_global_serializer similarly to how the blah_sleep()
94      releases it for the duration of the init function and firmware load.
95
96    * You may need a modevent infrastructure for module loading.  See the
97      original driver for code or one of the drivers already ported, like
98      netif/ath or netif/iwn
99
100    * SYSCTL macros in FreeBSD may have a CTLFLAG_RWTUN which for us is
101      just CTLFLAG_RW plus an additional TUNABLE* macro (see netif/ath
102      for examples).
103
104    * taskq_start_threads() API is slightly different.
105
106      taskqueue_start_threads(tq, 1, 0, name) ->
107      taskqueue_start_threads(tq, 1, TDPRI_KERN_DAEMON, -1, name)
108
109    * bus_setup_intr() is different.
110
111      bus_setup_intr(dev, irq, INTR_TYPE_NET | INTR_MPSAFE,
112			NULL, intrfunc, sc, &handle)		->
113      bus_setup_intr(dev, irq, INTR_MPSAFE,
114			intrfunc, sc, &handle, &wlan_global_serializer)
115
116    * callout API.  callout_init_mtx() is already macrod to
117      callout_init_lk().
118
119      callout_stop()	-> callout_cancel()
120      callout_sched()	-> must be converted to the proper callout_reset(...)
121			   call (function must be re-provided).
122
123    * bus_dma_tag_create() API is dfferent.
124
125      bus_dma_tag_create(tag, alignment,
126			 0,
127			 BUS_SPACE_MAXADDR_32BIT,
128			 BUS_SPACE_MAXADDR,
129			 NULL, NULL,
130			 size, 1, size,
131			 BUS_DMA_NOWAIT,
132			 NULL, NULL,
133			 &dma->tag)			-> to
134
135      bus_dma_tag_create(tag, alignment,
136			 0,
137			 BUS_SPACE_MAXADDR_32BIT,
138			 BUS_SPACE_MAXADDR,
139			 size, 1, size,
140			 BUS_DMA_NOWAIT, &dma->tag);
141
142    * device_printf() may be used with "%6D".  This is a FreeBSD specific
143      conversion specifier that was removed from DragonFly.  There is a
144      generic kether_ntoa() helper function that can be used for printing
145      MAC addresses. ath(4) also has an ath_hal_ether_sprintf() for this
146      purpose and the wlan stack has an ether_sprintf(). Simply removing
147      the __printflike() to silence the warning is wrong since that will
148      still not print the MAC address correctly (due to removed support
149      in the kprintf() functions).
150