* Fake up a node; this handles node discovery in adhoc mode. * Note that for the driver's benefit we we treat this like * an association so the driver has an opportunity to setup * it's private state. */
| 1681 | * it's private state. |
| 1682 | */ |
| 1683 | struct ieee80211_node * |
| 1684 | ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, |
| 1685 | const uint8_t macaddr[IEEE80211_ADDR_LEN]) |
| 1686 | { |
| 1687 | struct ieee80211_node *ni; |
| 1688 | |
| 1689 | IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE | IEEE80211_MSG_ASSOC, |
| 1690 | "%s: mac<%s>\n", __func__, ether_sprintf(macaddr)); |
| 1691 | ni = ieee80211_dup_bss(vap, macaddr); |
| 1692 | if (ni != NULL) { |
| 1693 | struct ieee80211com *ic = vap->iv_ic; |
| 1694 | |
| 1695 | /* XXX no rate negotiation; just dup */ |
| 1696 | ni->ni_rates = vap->iv_bss->ni_rates; |
| 1697 | if (ieee80211_iserp_rateset(&ni->ni_rates)) |
| 1698 | ni->ni_flags |= IEEE80211_NODE_ERP; |
| 1699 | if (vap->iv_opmode == IEEE80211_M_AHDEMO) { |
| 1700 | /* |
| 1701 | * In adhoc demo mode there are no management |
| 1702 | * frames to use to discover neighbor capabilities, |
| 1703 | * so blindly propagate the local configuration |
| 1704 | * so we can do interesting things (e.g. use |
| 1705 | * WME to disable ACK's). |
| 1706 | */ |
| 1707 | /* |
| 1708 | * XXX TODO: 11n? |
| 1709 | */ |
| 1710 | if (vap->iv_flags & IEEE80211_F_WME) |
| 1711 | ni->ni_flags |= IEEE80211_NODE_QOS; |
| 1712 | #ifdef IEEE80211_SUPPORT_SUPERG |
| 1713 | if (vap->iv_flags & IEEE80211_F_FF) |
| 1714 | ni->ni_flags |= IEEE80211_NODE_FF; |
| 1715 | #endif |
| 1716 | } |
| 1717 | ieee80211_node_setuptxparms(ni); |
| 1718 | ieee80211_ratectl_node_init(ni); |
| 1719 | |
| 1720 | /* |
| 1721 | * XXX TODO: 11n? At least 20MHz, at least A-MPDU RX, |
| 1722 | * not A-MPDU TX; not 11n rates, etc. We'll cycle |
| 1723 | * that after we hear that we can indeed do 11n |
| 1724 | * (either by a beacon frame or by a probe response.) |
| 1725 | */ |
| 1726 | |
| 1727 | /* |
| 1728 | * This is the first time we see the node. |
| 1729 | */ |
| 1730 | if (ic->ic_newassoc != NULL) |
| 1731 | ic->ic_newassoc(ni, 1); |
| 1732 | |
| 1733 | /* |
| 1734 | * Kick off a probe request to the given node; |
| 1735 | * we will then use the probe response to update |
| 1736 | * 11n/etc configuration state. |
| 1737 | * |
| 1738 | * XXX TODO: this isn't guaranteed, and until we get |
| 1739 | * a probe response, we won't be able to actually |
| 1740 | * do anything 802.11n related to the node. |
no test coverage detected