~serge-hallyn/ubuntu/oneiric/ipxe/link-kvm

« back to all changes in this revision

Viewing changes to src/net/80211/net80211.c

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2011-07-31 20:57:02 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110731205702-kffmzz6tnmgfw50f
Tags: 1.0.0+git-2.149b50-1
New snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
                              const void *ll_source, uint16_t net_proto );
136
136
static int net80211_ll_pull ( struct net_device *netdev,
137
137
                              struct io_buffer *iobuf, const void **ll_dest,
138
 
                              const void **ll_source, uint16_t * net_proto );
 
138
                              const void **ll_source, uint16_t * net_proto,
 
139
                              unsigned int *flags );
139
140
/** @} */
140
141
 
141
142
/**
159
160
 * @defgroup net80211_assoc_ll 802.11 association handling functions
160
161
 * @{
161
162
 */
162
 
static void net80211_step_associate ( struct process *proc );
 
163
static void net80211_step_associate ( struct net80211_device *dev );
163
164
static void net80211_handle_auth ( struct net80211_device *dev,
164
165
                                   struct io_buffer *iob );
165
166
static void net80211_handle_assoc_reply ( struct net80211_device *dev,
529
530
 * @ret ll_dest         Link-layer destination address
530
531
 * @ret ll_source       Link-layer source
531
532
 * @ret net_proto       Network-layer protocol, in network byte order
 
533
 * @ret flags           Packet flags
532
534
 * @ret rc              Return status code
533
535
 *
534
536
 * This expects and removes both the 802.11 frame header and the 802.2
537
539
static int net80211_ll_pull ( struct net_device *netdev __unused,
538
540
                              struct io_buffer *iobuf,
539
541
                              const void **ll_dest, const void **ll_source,
540
 
                              uint16_t * net_proto )
 
542
                              uint16_t * net_proto, unsigned int *flags )
541
543
{
542
544
        struct ieee80211_frame *hdr = iobuf->data;
543
545
        struct ieee80211_llc_snap_header *lhdr =
586
588
        *ll_dest = hdr->addr1;
587
589
        *ll_source = hdr->addr3;
588
590
        *net_proto = lhdr->ethertype;
 
591
        *flags = ( ( is_multicast_ether_addr ( hdr->addr1 ) ?
 
592
                     LL_MULTICAST : 0 ) |
 
593
                   ( is_broadcast_ether_addr ( hdr->addr1 ) ?
 
594
                     LL_BROADCAST : 0 ) );
589
595
        return 0;
590
596
}
591
597
 
729
735
 
730
736
/* ---------- Driver API ---------- */
731
737
 
 
738
/** 802.11 association process descriptor */
 
739
static struct process_descriptor net80211_process_desc =
 
740
        PROC_DESC ( struct net80211_device, proc_assoc,
 
741
                    net80211_step_associate );
 
742
 
732
743
/**
733
744
 * Allocate 802.11 device
734
745
 *
760
771
        dev->priv = ( u8 * ) dev + sizeof ( *dev );
761
772
        dev->op = &net80211_null_ops;
762
773
 
763
 
        process_init_stopped ( &dev->proc_assoc, net80211_step_associate,
 
774
        process_init_stopped ( &dev->proc_assoc, &net80211_process_desc,
764
775
                               &netdev->refcnt );
765
776
        INIT_LIST_HEAD ( &dev->mgmt_queue );
766
777
        INIT_LIST_HEAD ( &dev->mgmt_info_queue );
1630
1641
/**
1631
1642
 * Step 802.11 association process
1632
1643
 *
1633
 
 * @v proc      Association process
 
1644
 * @v dev       802.11 device
1634
1645
 */
1635
 
static void net80211_step_associate ( struct process *proc )
 
1646
static void net80211_step_associate ( struct net80211_device *dev )
1636
1647
{
1637
 
        struct net80211_device *dev =
1638
 
            container_of ( proc, struct net80211_device, proc_assoc );
1639
1648
        int rc = 0;
1640
1649
        int status = dev->state & NET80211_STATUS_MASK;
1641
1650
 
1836
1845
 
1837
1846
        dev->rctl = rc80211_init ( dev );
1838
1847
 
1839
 
        process_del ( proc );
 
1848
        process_del ( &dev->proc_assoc );
1840
1849
 
1841
1850
        DBGC ( dev, "802.11 %p associated with %s (%s)\n", dev,
1842
1851
               dev->essid, eth_ntoa ( dev->bssid ) );
1861
1870
        net80211_free_wlan ( dev->associating );
1862
1871
        dev->associating = NULL;
1863
1872
 
1864
 
        process_del ( proc );
 
1873
        process_del ( &dev->proc_assoc );
1865
1874
 
1866
1875
        DBGC ( dev, "802.11 %p association failed (state=%04x): "
1867
1876
               "%s\n", dev, dev->state, strerror ( dev->assoc_rc ) );