| 4671 | } |
| 4672 | |
| 4673 | static enum ieee80211_opmode |
| 4674 | get80211opmode(int s) |
| 4675 | { |
| 4676 | struct ifmediareq ifmr; |
| 4677 | |
| 4678 | (void) memset(&ifmr, 0, sizeof(ifmr)); |
| 4679 | (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); |
| 4680 | |
| 4681 | if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) { |
| 4682 | if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) { |
| 4683 | if (ifmr.ifm_current & IFM_FLAG0) |
| 4684 | return IEEE80211_M_AHDEMO; |
| 4685 | else |
| 4686 | return IEEE80211_M_IBSS; |
| 4687 | } |
| 4688 | if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP) |
| 4689 | return IEEE80211_M_HOSTAP; |
| 4690 | if (ifmr.ifm_current & IFM_IEEE80211_IBSS) |
| 4691 | return IEEE80211_M_IBSS; |
| 4692 | if (ifmr.ifm_current & IFM_IEEE80211_MONITOR) |
| 4693 | return IEEE80211_M_MONITOR; |
| 4694 | if (ifmr.ifm_current & IFM_IEEE80211_MBSS) |
| 4695 | return IEEE80211_M_MBSS; |
| 4696 | } |
| 4697 | return IEEE80211_M_STA; |
| 4698 | } |
| 4699 | |
| 4700 | #if 0 |
| 4701 | static void |
no test coverage detected