Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame^] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | #ifndef _WLAN_HDD_ETHER_H |
| 29 | #define _WLAN_HDD_ETHER_H |
| 30 | /*============================================================================ |
| 31 | @file wlan_hdd_ether.h |
| 32 | |
| 33 | This module describes Ethernet packet formats for processing by HDD. |
| 34 | |
| 35 | Copyright (c) 2009 QUALCOMM Incorporated. |
| 36 | All Rights Reserved. |
| 37 | Qualcomm Confidential and Proprietary |
| 38 | ============================================================================*/ |
| 39 | /* $Header$ */ |
| 40 | |
| 41 | /*---------------------------------------------------------------------------- |
| 42 | * Include Files |
| 43 | * -------------------------------------------------------------------------*/ |
| 44 | #include <linux/version.h> |
| 45 | #include <linux/byteorder/generic.h> |
| 46 | #include <linux/if_ether.h> |
| 47 | #include <linux/if_vlan.h> |
| 48 | |
| 49 | /*---------------------------------------------------------------------------- |
| 50 | * Preprocessor Definitions and Constants |
| 51 | * -------------------------------------------------------------------------*/ |
| 52 | #define WLAN_SNAP_OUI_LEN 3 |
| 53 | #define WLAN_SNAP_DSAP 0xAAU |
| 54 | #define WLAN_SNAP_SSAP 0xAAU |
| 55 | #define WLAN_SNAP_CTRL 0x03 |
| 56 | #define WLAN_MIN_PROTO 0x0600 |
| 57 | |
| 58 | /*---------------------------------------------------------------------------- |
| 59 | * Type Declarations |
| 60 | * -------------------------------------------------------------------------*/ |
| 61 | struct wlan_snap_hdr { |
| 62 | unsigned char dsap; |
| 63 | unsigned char ssap; |
| 64 | unsigned char ctrl; |
| 65 | unsigned char oui[WLAN_SNAP_OUI_LEN]; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 66 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 67 | |
| 68 | struct wlan_8023 { |
| 69 | unsigned char h_dest[ETH_ALEN]; |
| 70 | unsigned char h_source[ETH_ALEN]; |
| 71 | __be16 h_len; |
| 72 | struct wlan_snap_hdr h_snap; |
| 73 | __be16 h_proto; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 74 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 75 | |
| 76 | struct wlan_8023_vlan { |
| 77 | unsigned char h_dest[ETH_ALEN]; |
| 78 | unsigned char h_source[ETH_ALEN]; |
| 79 | __be16 h_vlan_proto; |
| 80 | __be16 h_vlan_TCI; |
| 81 | __be16 h_len; |
| 82 | struct wlan_snap_hdr h_snap; |
| 83 | __be16 h_proto; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 84 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 85 | |
| 86 | union generic_ethhdr { |
| 87 | struct ethhdr eth_II; |
| 88 | struct vlan_ethhdr eth_IIv; |
| 89 | struct wlan_8023 eth_8023; |
| 90 | struct wlan_8023_vlan eth_8023v; |
| 91 | }; |
| 92 | |
| 93 | #endif /* #ifndef _WLAN_HDD_ETHER_H */ |