2007-08-10 21:17:33

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] hostapd: make it work on the latest kernel

i802_if_update isn't actually used so remove all code from it, add
ieee80211_msg_passive_scan as our own constant and #if 0 more code in
handle_frame()

Signed-off-by: Johannes Berg <[email protected]>

diff --git a/hostapd/driver_devicescape.c b/hostapd/driver_devicescape.c
index 73e05f0..de8fe4a 100644
--- a/hostapd/driver_devicescape.c
+++ b/hostapd/driver_devicescape.c
@@ -39,6 +39,11 @@
#include "hw_features.h"
#include <hostapd_ioctl.h>
#include <ieee80211_common.h>
+
+/* there used to be this constant in the kernel sources, but
+ * the kernel no longer needs it.... we use it internally.... */
+#define ieee80211_msg_passive_scan 3
+
/* from net/mac80211.h */
enum {
MODE_IEEE80211A = 0 /* IEEE 802.11a */,
@@ -1021,32 +1026,8 @@ static int i802_if_add(const char *iface, void *priv,
static int i802_if_update(void *priv, enum hostapd_driver_if_type type,
char *ifname, const u8 *addr)
{
- struct i802_driver_data *drv = priv;
- struct prism2_hostapd_param *param;
-
- param = malloc(sizeof(struct prism2_hostapd_param) + ETH_ALEN);
- if (!param)
- return -1;
- memset(param, 0, sizeof(param));
-
- param->cmd = PRISM2_HOSTAPD_UPDATE_IF;
- param->u.if_info.type = i802_if_type(type);
- if (addr)
- memcpy(param->u.if_info.data, addr, ETH_ALEN);
- else
- memset(param->u.if_info.data, 0, ETH_ALEN);
- os_strlcpy((char *) param->u.if_info.name, ifname, IFNAMSIZ);
-
- /* FIX: should the size have + ETH_ALEN ? */
- if (hostapd_ioctl(drv, param, sizeof(struct prism2_hostapd_param))) {
- printf("Could not update iface: %s.\n", ifname);
- free(param);
- return -1;
- }
-
- os_strlcpy(ifname, (char *) param->u.if_info.name, IFNAMSIZ);
- free(param);
- return 0;
+ /* unused at the moment */
+ return -1;
}


@@ -1354,13 +1335,13 @@ static void handle_frame(struct hostapd_iface *iface, u8 *buf, size_t len,
int msg_type = ntohl(fi->msg_type);
struct hostapd_frame_info hfi;

+#if 0 /* TODO */
/* special handling for message types without IEEE 802.11 header */
if (msg_type == ieee80211_msg_set_aid_for_sta) {
-#if 0 /* TODO */
ieee802_11_set_aid_for_sta(iface->bss[0], buf, data_len);
-#endif
return;
}
+#endif
if (msg_type == ieee80211_msg_key_threshold_notification) {
#if 0 /* TODO */
ieee802_11_key_threshold_notification(iface->bss[0], buf,




2007-08-15 03:28:08

by Jouni Malinen

[permalink] [raw]
Subject: Re: [PATCH] hostapd: make it work on the latest kernel

On Fri, Aug 10, 2007 at 11:20:05PM +0200, Johannes Berg wrote:
> i802_if_update isn't actually used so remove all code from it, add
> ieee80211_msg_passive_scan as our own constant and #if 0 more code in
> handle_frame()

Thanks, applied. I think that if_update handler can disappear completely
since it was only used in code that was not merged into the hostapd
releases and I don't have plans on merging it in the future. Similarly,
ieee80211_msg_passive_scan should just go away and like the #if 0'ed
blocks (or at least most of them).

Since there are number of pending patches to driver_devicescape.c, I'll
postpone some of the additional cleanup for now, but this will likely
happen once I've had chance of getting through the queue.

--
Jouni Malinen PGP id EFC895FA