freebsd11_network: Remove IFT_IEEE80211 logic.

Previous versions of FreeBSD created a base ifp of type IFT_IEEE80211
in addition to the ifp created for each VAP. We ignored these, so that
the devices we displayed (/dev/.../0, etc.) were numbered properly.

FreeBSD 11 no longer does this and instead uses an ieee80211com as its base
type, so this logic is not needed.
This commit is contained in:
Augustin Cavalier
2018-06-27 20:14:35 -04:00
parent 83fee6c8b6
commit 2ed3d6d1b5
3 changed files with 5 additions and 27 deletions
@@ -9,6 +9,4 @@
#include <posix/net/if_types.h> #include <posix/net/if_types.h>
#define IFT_IEEE80211 0x47
#endif /* _FBSD_COMPAT_NET_IF_TYPES_H_ */ #endif /* _FBSD_COMPAT_NET_IF_TYPES_H_ */
@@ -79,7 +79,6 @@ status_t start_wlan(device_t);
status_t stop_wlan(device_t); status_t stop_wlan(device_t);
status_t wlan_control(void*, uint32, void*, size_t); status_t wlan_control(void*, uint32, void*, size_t);
status_t wlan_close(void*); status_t wlan_close(void*);
status_t wlan_if_l2com_alloc(void*);
/* we define the driver methods with HAIKU_FBSD_DRIVERS_GLUE to /* we define the driver methods with HAIKU_FBSD_DRIVERS_GLUE to
* force the rest of the stuff to be linked back with the driver. * force the rest of the stuff to be linked back with the driver.
@@ -118,8 +117,6 @@ status_t wlan_if_l2com_alloc(void*);
size_t length) \ size_t length) \
{ return B_BAD_VALUE; } \ { return B_BAD_VALUE; } \
status_t wlan_close(void* cookie) \ status_t wlan_close(void* cookie) \
{ return B_OK; } \
status_t wlan_if_l2com_alloc(void* ifp) \
{ return B_OK; } { return B_OK; }
#define HAIKU_FBSD_DRIVER_GLUE(publicname, name, busname) \ #define HAIKU_FBSD_DRIVER_GLUE(publicname, name, busname) \
+5 -22
View File
@@ -174,12 +174,6 @@ if_alloc(u_char type)
IFP2AC(ifp)->ac_ifp = ifp; IFP2AC(ifp)->ac_ifp = ifp;
break; break;
} }
case IFT_IEEE80211:
{
if (wlan_if_l2com_alloc(ifp) != B_OK)
goto err2;
break;
}
} }
ifp->link_state_sem = -1; ifp->link_state_sem = -1;
@@ -210,7 +204,6 @@ if_alloc(u_char type)
err3: err3:
switch (type) { switch (type) {
case IFT_ETHER: case IFT_ETHER:
case IFT_IEEE80211:
_kernel_free(ifp->if_l2com); _kernel_free(ifp->if_l2com);
break; break;
} }
@@ -239,7 +232,6 @@ if_free(struct ifnet *ifp)
IF_ADDR_LOCK_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp);
switch (ifp->if_type) { switch (ifp->if_type) {
case IFT_ETHER: case IFT_ETHER:
case IFT_IEEE80211:
_kernel_free(ifp->if_l2com); _kernel_free(ifp->if_l2com);
break; break;
} }
@@ -268,16 +260,7 @@ if_initname(struct ifnet *ifp, const char *name, int unit)
gDriverName, ifp->if_index); gDriverName, ifp->if_index);
driver_printf("%s: /dev/%s\n", gDriverName, ifp->device_name); driver_printf("%s: /dev/%s\n", gDriverName, ifp->device_name);
insert_into_device_name_list(ifp);
// For wlan devices we only want to see the cloned wlan device
// in the list.
// Remember: For each wlan device, there is a base device of type
// IFT_IEEE80211. On top of that a clone device is created of
// type IFT_ETHER.
// Haiku shall only see the cloned device as it is the one
// FreeBSD 8 uses for wireless i/o, too.
if (ifp->if_type == IFT_ETHER)
insert_into_device_name_list(ifp);
ifp->root_device = find_root_device(unit); ifp->root_device = find_root_device(unit);
} }
@@ -1008,7 +991,7 @@ if_getcapabilities(if_t ifp)
return ((struct ifnet *)ifp)->if_capabilities; return ((struct ifnet *)ifp)->if_capabilities;
} }
int int
if_setcapenable(if_t ifp, int capabilities) if_setcapenable(if_t ifp, int capabilities)
{ {
((struct ifnet *)ifp)->if_capenable = capabilities; ((struct ifnet *)ifp)->if_capenable = capabilities;
@@ -1157,16 +1140,16 @@ if_getsoftc(if_t ifp)
return ((struct ifnet *)ifp)->if_softc; return ((struct ifnet *)ifp)->if_softc;
} }
void void
if_setrcvif(struct mbuf *m, if_t ifp) if_setrcvif(struct mbuf *m, if_t ifp)
{ {
m->m_pkthdr.rcvif = (struct ifnet *)ifp; m->m_pkthdr.rcvif = (struct ifnet *)ifp;
} }
void void
if_setvtag(struct mbuf *m, uint16_t tag) if_setvtag(struct mbuf *m, uint16_t tag)
{ {
m->m_pkthdr.ether_vtag = tag; m->m_pkthdr.ether_vtag = tag;
} }
uint16_t uint16_t