-/* $OpenBSD: ieee80211_proto.c,v 1.81 2017/12/08 21:16:01 stsp Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.82 2018/02/05 08:44:13 stsp Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
}
}
+#ifndef IEEE80211_STA_ONLY
+void
+ieee80211_auth_open_confirm(struct ieee80211com *ic,
+ struct ieee80211_node *ni, uint16_t seq)
+{
+ struct ifnet *ifp = &ic->ic_if;
+
+ IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1);
+ if (ifp->if_flags & IFF_DEBUG)
+ printf("%s: station %s %s authenticated (open)\n",
+ ifp->if_xname,
+ ether_sprintf((u_int8_t *)ni->ni_macaddr),
+ ni->ni_state != IEEE80211_STA_CACHE ?
+ "newly" : "already");
+ ieee80211_node_newstate(ni, IEEE80211_STA_AUTH);
+}
+#endif
+
void
ieee80211_auth_open(struct ieee80211com *ic, const struct ieee80211_frame *wh,
struct ieee80211_node *ni, struct ieee80211_rxinfo *rxi, u_int16_t seq,
ni->ni_rstamp = rxi->rxi_tstamp;
ni->ni_chan = ic->ic_bss->ni_chan;
}
- IEEE80211_SEND_MGMT(ic, ni,
- IEEE80211_FC0_SUBTYPE_AUTH, seq + 1);
- if (ifp->if_flags & IFF_DEBUG)
- printf("%s: station %s %s authenticated (open)\n",
- ifp->if_xname,
- ether_sprintf((u_int8_t *)ni->ni_macaddr),
- ni->ni_state != IEEE80211_STA_CACHE ?
- "newly" : "already");
- ieee80211_node_newstate(ni, IEEE80211_STA_AUTH);
+
+ /*
+ * Drivers may want to set up state before confirming.
+ * In which case this returns EBUSY and the driver will
+ * later call ieee80211_auth_open_confirm() by itself.
+ */
+ if (ic->ic_newauth && ic->ic_newauth(ic, ni,
+ ni->ni_state != IEEE80211_STA_CACHE, seq) != 0)
+ break;
+ ieee80211_auth_open_confirm(ic, ni, seq);
break;
#endif /* IEEE80211_STA_ONLY */
-/* $OpenBSD: ieee80211_proto.h,v 1.43 2017/10/21 20:15:17 patrick Exp $ */
+/* $OpenBSD: ieee80211_proto.h,v 1.44 2018/02/05 08:44:13 stsp Exp $ */
/* $NetBSD: ieee80211_proto.h,v 1.3 2003/10/13 04:23:56 dyoung Exp $ */
/*-
struct ieee80211_node *, u_int64_t);
extern void ieee80211_reset_erp(struct ieee80211com *);
extern void ieee80211_set_shortslottime(struct ieee80211com *, int);
+extern void ieee80211_auth_open_confirm(struct ieee80211com *,
+ struct ieee80211_node *, uint16_t);
extern void ieee80211_auth_open(struct ieee80211com *,
const struct ieee80211_frame *, struct ieee80211_node *,
struct ieee80211_rxinfo *rs, u_int16_t, u_int16_t);
-/* $OpenBSD: ieee80211_var.h,v 1.83 2017/12/12 15:50:39 stsp Exp $ */
+/* $OpenBSD: ieee80211_var.h,v 1.84 2018/02/05 08:44:13 stsp Exp $ */
/* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */
/*-
struct ieee80211_node *, int, int, int);
int (*ic_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
+ int (*ic_newauth)(struct ieee80211com *,
+ struct ieee80211_node *, int, uint16_t);
void (*ic_newassoc)(struct ieee80211com *,
struct ieee80211_node *, int);
void (*ic_node_leave)(struct ieee80211com *,