contrib/hostapd/hostapd/driver_prism54.c
static int prism54_init_1x(void *priv)
{
	struct prism54_driver_data *drv = priv;
	pimdev_hdr *hdr;
	unsigned long *ul;
	int blen = sizeof(*hdr) + sizeof(*ul);

	hdr = malloc(blen);
	if (hdr == NULL)
		return -1;

	ul = (unsigned long *) &hdr[1];
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_EXUNENCRYPTED);
	*ul = htonl(DOT11_BOOL_TRUE); /* not accept */
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_EXUNENCRYPTED, hdr, blen, 10);
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_MLMEAUTOLEVEL);
	*ul = htonl(DOT11_MLME_EXTENDED);
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_MLMEAUTOLEVEL, hdr, blen, 10);
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_DOT1XENABLE);
	*ul = htonl(DOT11_BOOL_TRUE);
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_DOT1XENABLE, hdr, blen, 10);
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_AUTHENABLE);
	*ul = htonl(DOT11_AUTH_OS); /* OS */
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_AUTHENABLE, hdr, blen, 10);
	free(hdr);
	return 0;
}
/* include unencrypted, set mlme autolevel to extended */
include unencrypted, set mlme autolevel to extended
include unencrypted set mlme autolevel to extended
static int prism54_init_1x(void *priv)
{
	struct prism54_driver_data *drv = priv;
	pimdev_hdr *hdr;
	unsigned long *ul;
	int blen = sizeof(*hdr) + sizeof(*ul);
	hdr = malloc(blen);
	if (hdr == NULL)
		return -1;
	ul = (unsigned long *) &hdr[1];
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_EXUNENCRYPTED);
	*ul = htonl(DOT11_BOOL_TRUE); 
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_EXUNENCRYPTED, hdr, blen, 10);
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_MLMEAUTOLEVEL);
	*ul = htonl(DOT11_MLME_EXTENDED);
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_MLMEAUTOLEVEL, hdr, blen, 10);
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_DOT1XENABLE);
	*ul = htonl(DOT11_BOOL_TRUE);
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_DOT1XENABLE, hdr, blen, 10);
	hdr->op = htonl(PIMOP_SET);
	hdr->oid = htonl(DOT11_OID_AUTHENABLE);
	*ul = htonl(DOT11_AUTH_OS); 
	send(drv->pim_sock, hdr, blen, 0);
	prism54_waitpim(priv, DOT11_OID_AUTHENABLE, hdr, blen, 10);
	free(hdr);
	return 0;
}
static int prism54_init_1x ( void * priv ) { struct prism54_driver_data * drv = priv ; pimdev_hdr * hdr ; unsigned long * ul ; int blen = sizeof ( * hdr ) + sizeof ( * ul ) ; hdr = malloc ( blen ) ; if ( hdr == NULL ) return -1 ; ul = ( unsigned long * ) & hdr [ 1 ] ; hdr -> op = htonl ( PIMOP_SET ) ; hdr -> oid = htonl ( DOT11_OID_EXUNENCRYPTED ) ; * ul = htonl ( DOT11_BOOL_TRUE ) ; send ( drv -> pim_sock , hdr , blen , 0 ) ; prism54_waitpim ( priv , DOT11_OID_EXUNENCRYPTED , hdr , blen , 10 ) ; hdr -> op = htonl ( PIMOP_SET ) ; hdr -> oid = htonl ( DOT11_OID_MLMEAUTOLEVEL ) ; * ul = htonl ( DOT11_MLME_EXTENDED ) ; send ( drv -> pim_sock , hdr , blen , 0 ) ; prism54_waitpim ( priv , DOT11_OID_MLMEAUTOLEVEL , hdr , blen , 10 ) ; hdr -> op = htonl ( PIMOP_SET ) ; hdr -> oid = htonl ( DOT11_OID_DOT1XENABLE ) ; * ul = htonl ( DOT11_BOOL_TRUE ) ; send ( drv -> pim_sock , hdr , blen , 0 ) ; prism54_waitpim ( priv , DOT11_OID_DOT1XENABLE , hdr , blen , 10 ) ; hdr -> op = htonl ( PIMOP_SET ) ; hdr -> oid = htonl ( DOT11_OID_AUTHENABLE ) ; * ul = htonl ( DOT11_AUTH_OS ) ; send ( drv -> pim_sock , hdr , blen , 0 ) ; prism54_waitpim ( priv , DOT11_OID_AUTHENABLE , hdr , blen , 10 ) ; free ( hdr ) ; return 0 ; }
include unencrypted, set mlme autolevel to extended
include unencrypted set mlme autolevel to extended
/* not accept */ /* OS */