blob: 5b2c48e4faf94fa041876e5172a6567b2edacbe2 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -08002 * 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 Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
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 Johnson295189b2012-06-20 16:38:30 -070028#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 * -------------------------------------------------------------------------*/
61struct 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 Koyyalamudi4e31b132012-11-02 13:13:52 -070066} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -070067
68struct 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 Koyyalamudi4e31b132012-11-02 13:13:52 -070074} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -070075
76struct 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 Koyyalamudi4e31b132012-11-02 13:13:52 -070084} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -070085
86union 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 */