# HG changeset patch # User Joseph Jezak # Node ID 1dcc1205cc139dfd0529bd8d6efa3eee24e4cca2 # Parent ec3ea487a296aca84ed627a371ba89bc24d41d28 Fixed compile errors. diff -r ec3ea487a296 -r 1dcc1205cc13 Makefile --- a/Makefile Fri Nov 25 16:27:40 2005 +++ b/Makefile Fri Nov 25 18:25:54 2005 @@ -24,6 +24,7 @@ obj-m := ieee80211softmac.o ieee80211softmac-objs := \ + ieee80211softmac_io.o \ ieee80211softmac_module.o \ ieee80211softmac_scan.o \ ieee80211softmac_wx.o diff -r ec3ea487a296 -r 1dcc1205cc13 ieee80211softmac.h --- a/ieee80211softmac.h Fri Nov 25 16:27:40 2005 +++ b/ieee80211softmac.h Fri Nov 25 18:25:54 2005 @@ -16,7 +16,7 @@ struct ieee80211softmac_device { /* 802.11 structure for data stuff */ - struct ieee80211 *ieee; + struct ieee80211_device *ieee; struct net_device *dev; /* the following methods are callbacks that the driver diff -r ec3ea487a296 -r 1dcc1205cc13 ieee80211softmac_io.c --- a/ieee80211softmac_io.c Fri Nov 25 16:27:40 2005 +++ b/ieee80211softmac_io.c Fri Nov 25 18:25:54 2005 @@ -33,6 +33,7 @@ */ #include "ieee80211softmac.h" +#include /* Helper functions for inserting data into the frames */ @@ -66,8 +67,8 @@ /* Allocate a management frame */ -static sk_buff * -ieee80211softmac_alloc_mgt(uint32 size) +static struct sk_buff * +ieee80211softmac_alloc_mgt(u32 size) { struct sk_buff *skb; /* Add the header and FCS to the size */ @@ -76,15 +77,15 @@ return NULL; /* Allocate the skb */ - skb = skb_alloc(size, GPF_ATOMIC); + skb = alloc_skb(size, GFP_ATOMIC); return skb; } /* Add a header to a management frame */ static u8 * ieee80211softmac_add_3addr(struct ieee80211softmac_device* mac, - u8 * dst, struct ieee80211softmac_network *net, u32 type) + u8 * dst, struct ieee80211_network *net, u32 type) { - struct ieee80211_hdr_3addr *header = (iee80211_hdr_3addr *)dst; + struct ieee80211_hdr_3addr *header = (struct ieee80211_hdr_3addr *)dst; /* Setup the FC */ /* DA */ @@ -105,22 +106,22 @@ * arg - Optional args for the frame * */ - +int ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac, - struct ieee80211softmac_network *net, u32 type, u32 arg) + struct ieee80211_network *net, u32 type, u32 arg) { struct sk_buff *skb; - struct ieee80211_device *ieee = mac->ieee; int pkt_size = 0; + u16 status, seq, reason; + u8 *data; switch (type) { case IEEE80211_STYPE_ASSOC_REQ: case IEEE80211_STYPE_REASSOC_REQ: break; case IEEE80211_STYPE_AUTH: - u16 status = (arg >> 16) & 0xFFFF; /* Status field */ - u16 seq = (arg & 0xFFFF); /* Seq Number */ - struct ieee80211_auth *auth; + status = (arg >> 16) & 0xFFFF; /* Status field */ + seq = (arg & 0xFFFF); /* Seq Number */ pkt_size = ( 2 + /* Auth Algorithm */ 2 + /* Auth Transaction Seq */ @@ -129,31 +130,41 @@ ); /* Allocate Packet */ - skb = ieee80211softmac_alloc_mgt(pkt_size, GPF_ATOMIC); + skb = ieee80211softmac_alloc_mgt(pkt_size); if(skb == NULL) return -ENOMEM; - auth = (ieee80211_auth *) skb->data; + data = skb->data + IEEE80211_3ADDR_LEN; - auth->algorithm = cpu_to_le16(0); /* FIXME Open, for now */ - auth->transaction = cpu_to_le16(seq); - auth->status = cpu_to_le16(status); + /* Algorithm */ + *data = cpu_to_le16(0); /* FIXME Open, for now */ + data += sizeof(u16); + + /* Transaction */ + *data = cpu_to_le16(seq); + data += sizeof(u16); + + /* Status */ + *data = cpu_to_le16(status); + data += sizeof(u16); /* FIXME Challenge Text */ break; /* These have the same format */ case IEEE80211_STYPE_DISASSOC: case IEEE80211_STYPE_DEAUTH: - struct ieee80211_disassoc *disassoc; - int reason = arg & 0xFFFF; + reason = arg & 0xFFFF; pkt_size = 2; /* Reason Code */ /* Allocate Packet */ - skb = ieee80211softmac_alloc_mgt(pkt_size, GPF_ATOMIC); + skb = ieee80211softmac_alloc_mgt(pkt_size); if(skb == NULL) return -ENOMEM; - disassoc = (ieee80211_disassoc *)skb->data; - disassoc->reason = cpu_to_le16(reason); + data = skb->data + IEEE80211_3ADDR_LEN; + + /* Reason */ + *data = cpu_to_le16(reason); + data += sizeof(u16); break; default: - return = -EINVAL; + return -EINVAL; break; }; @@ -161,7 +172,7 @@ ieee80211softmac_add_3addr(mac, skb->head, net, type); /* Send the packet to the ieee80211 layer for tx */ - ieee80211_xmit(skb, ieee->dev); + ieee80211_xmit(skb, mac->ieee->dev); /* FIXME check if the xmit free's the skb and if not, * is it safe to do so here? */ @@ -170,7 +181,8 @@ /* Sends a beacon frame */ -ieee80211softmac_send_bcn_frame( ) +int +ieee80211softmac_send_bcn_frame(void) { - + return 0; }