]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
BSD: Driver does not need to know about both wpa and hostap contexts
authorRoy Marples <roy@marples.name>
Tue, 28 Jan 2020 16:58:26 +0000 (16:58 +0000)
committerJouni Malinen <jouni@codeaurora.org>
Sun, 2 Feb 2020 19:44:23 +0000 (21:44 +0200)
It will either be one or the other.
Fold hapd into ctx to match other drivers.

Signed-off-by: Roy Marples <roy@marples.name>
src/drivers/driver_bsd.c

index a9b5d002de9f357e9c5d751c25279879eca9abcf..5e288481420681f7f9a1aebc9870b2e39a8f661c 100644 (file)
@@ -59,14 +59,13 @@ struct bsd_driver_global {
 struct bsd_driver_data {
        struct dl_list  list;
        struct bsd_driver_global *global;
-       struct hostapd_data *hapd;      /* back pointer */
+       void    *ctx;
 
        struct l2_packet_data *sock_xmit;/* raw packet xmit socket */
        char    ifname[IFNAMSIZ+1];     /* interface name */
        int     flags;
        unsigned int ifindex;           /* interface index */
        int     if_removed;             /* has the interface been removed? */
-       void    *ctx;
        struct wpa_driver_capa capa;    /* driver capability */
        int     is_ap;                  /* Access point mode */
        int     prev_roaming;   /* roaming state to restore on deinit */
@@ -816,14 +815,14 @@ bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
                        break;
                case RTM_IEEE80211_LEAVE:
                        leave = (struct ieee80211_leave_event *) &ifan[1];
-                       drv_event_disassoc(drv->hapd, leave->iev_addr);
+                       drv_event_disassoc(drv->ctx, leave->iev_addr);
                        break;
                case RTM_IEEE80211_JOIN:
 #ifdef RTM_IEEE80211_REJOIN
                case RTM_IEEE80211_REJOIN:
 #endif
                        join = (struct ieee80211_join_event *) &ifan[1];
-                       bsd_new_sta(drv, drv->hapd, join->iev_addr);
+                       bsd_new_sta(drv, drv->ctx, join->iev_addr);
                        break;
                case RTM_IEEE80211_REPLAY:
                        /* ignore */
@@ -837,7 +836,7 @@ bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx)
                        os_memset(&data, 0, sizeof(data));
                        data.michael_mic_failure.unicast = 1;
                        data.michael_mic_failure.src = mic->iev_src;
-                       wpa_supplicant_event(drv->hapd,
+                       wpa_supplicant_event(drv->ctx,
                                             EVENT_MICHAEL_MIC_FAILURE, &data);
                        break;
                }
@@ -849,7 +848,7 @@ static void
 handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 {
        struct bsd_driver_data *drv = ctx;
-       drv_event_eapol_rx(drv->hapd, src_addr, buf, len);
+       drv_event_eapol_rx(drv->ctx, src_addr, buf, len);
 }
 
 static void *
@@ -870,7 +869,7 @@ bsd_init(struct hostapd_data *hapd, struct wpa_init_params *params)
                goto bad;
        }
 
-       drv->hapd = hapd;
+       drv->ctx = hapd;
        drv->global = params->global_priv;
        os_strlcpy(drv->ifname, params->ifname, sizeof(drv->ifname));