Silenced some of the driver-related messages for driver=none case

No need to print these to confuse users that configure hostapd as a RADIUS
server without any AP functionality.
This commit is contained in:
Jouni Malinen 2008-10-01 14:17:35 +03:00 committed by Jouni Malinen
parent d64dabeebc
commit 85141289d5
3 changed files with 31 additions and 11 deletions

View file

@ -766,4 +766,10 @@ hostapd_set_ht_operation(const char *ifname, struct hostapd_data *hapd,
} }
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */
static inline int
hostapd_drv_none(struct hostapd_data *hapd)
{
return hapd->driver && os_strcmp(hapd->driver->name, "none") == 0;
}
#endif /* DRIVER_H */ #endif /* DRIVER_H */

View file

@ -677,6 +677,9 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd)
{ {
int ret = 0; int ret = 0;
if (hostapd_drv_none(hapd))
return 0;
wpa_printf(MSG_DEBUG, "Flushing old station entries"); wpa_printf(MSG_DEBUG, "Flushing old station entries");
if (hostapd_flush(hapd)) { if (hostapd_flush(hapd)) {
printf("Could not connect to kernel driver.\n"); printf("Could not connect to kernel driver.\n");
@ -1006,6 +1009,9 @@ static int hostapd_validate_bssid_configuration(struct hostapd_iface *iface)
unsigned int i = iface->conf->num_bss, bits = 0, j; unsigned int i = iface->conf->num_bss, bits = 0, j;
int res; int res;
if (hostapd_drv_none(hapd))
return 0;
/* Generate BSSID mask that is large enough to cover the BSSIDs. */ /* Generate BSSID mask that is large enough to cover the BSSIDs. */
/* Determine the bits necessary to cover the number of BSSIDs. */ /* Determine the bits necessary to cover the number of BSSIDs. */
@ -1253,9 +1259,12 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
conf->ssid.ssid[conf->ssid.ssid_len] = '\0'; conf->ssid.ssid[conf->ssid.ssid_len] = '\0';
} }
printf("Using interface %s with hwaddr " MACSTR " and ssid '%s'\n", if (!hostapd_drv_none(hapd)) {
printf("Using interface %s with hwaddr " MACSTR
" and ssid '%s'\n",
hapd->conf->iface, MAC2STR(hapd->own_addr), hapd->conf->iface, MAC2STR(hapd->own_addr),
hapd->conf->ssid.ssid); hapd->conf->ssid.ssid);
}
if (hostapd_setup_wpa_psk(conf)) { if (hostapd_setup_wpa_psk(conf)) {
printf("WPA-PSK setup failed.\n"); printf("WPA-PSK setup failed.\n");
@ -1320,19 +1329,22 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
return -1; return -1;
} }
if (vlan_init(hapd)) { if (!hostapd_drv_none(hapd) && vlan_init(hapd)) {
printf("VLAN initialization failed.\n"); printf("VLAN initialization failed.\n");
return -1; return -1;
} }
#ifdef CONFIG_IEEE80211R #ifdef CONFIG_IEEE80211R
if (!hostapd_drv_none(hapd)) {
hapd->l2 = l2_packet_init(hapd->conf->iface, NULL, ETH_P_RRB, hapd->l2 = l2_packet_init(hapd->conf->iface, NULL, ETH_P_RRB,
hostapd_rrb_receive, hapd, 0); hostapd_rrb_receive, hapd, 0);
if (hapd->l2 == NULL && if (hapd->l2 == NULL &&
(hapd->driver == NULL || hapd->driver->send_ether == NULL)) { (hapd->driver == NULL ||
hapd->driver->send_ether == NULL)) {
printf("Failed to open l2_packet interface\n"); printf("Failed to open l2_packet interface\n");
return -1; return -1;
} }
}
#endif /* CONFIG_IEEE80211R */ #endif /* CONFIG_IEEE80211R */
ieee802_11_set_beacon(hapd); ieee802_11_set_beacon(hapd);
@ -1876,7 +1888,7 @@ static void setup_interface_done(struct hostapd_iface *iface, int status)
wpa_printf(MSG_DEBUG, "%s: Unable to setup interface.", wpa_printf(MSG_DEBUG, "%s: Unable to setup interface.",
iface->bss[0]->conf->iface); iface->bss[0]->conf->iface);
eloop_terminate(); eloop_terminate();
} else } else if (!hostapd_drv_none(iface->bss[0]))
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
iface->bss[0]->conf->iface); iface->bss[0]->conf->iface);
} }

View file

@ -46,6 +46,8 @@ int hostapd_get_hw_features(struct hostapd_iface *iface)
u16 num_modes, flags; u16 num_modes, flags;
struct hostapd_hw_modes *modes; struct hostapd_hw_modes *modes;
if (hostapd_drv_none(hapd))
return -1;
modes = hostapd_get_hw_feature_data(hapd, &num_modes, &flags); modes = hostapd_get_hw_feature_data(hapd, &num_modes, &flags);
if (modes == NULL) { if (modes == NULL) {
hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,