Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
drivers
net
ethernet
sfc
filter.h
Go to the documentation of this file.
1
/****************************************************************************
2
* Driver for Solarflare Solarstorm network controllers and boards
3
* Copyright 2005-2010 Solarflare Communications Inc.
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 as published
7
* by the Free Software Foundation, incorporated herein by reference.
8
*/
9
10
#ifndef EFX_FILTER_H
11
#define EFX_FILTER_H
12
13
#include <linux/types.h>
14
29
enum
efx_filter_type
{
30
EFX_FILTER_TCP_FULL
= 0,
31
EFX_FILTER_TCP_WILD
,
32
EFX_FILTER_UDP_FULL
,
33
EFX_FILTER_UDP_WILD
,
34
EFX_FILTER_MAC_FULL
= 4,
35
EFX_FILTER_MAC_WILD
,
36
EFX_FILTER_UC_DEF
= 8,
37
EFX_FILTER_MC_DEF
,
38
EFX_FILTER_TYPE_COUNT
,
/* number of specific types */
39
EFX_FILTER_UNSPEC
= 0xf,
40
};
41
49
enum
efx_filter_priority
{
50
EFX_FILTER_PRI_HINT
= 0,
51
EFX_FILTER_PRI_MANUAL
,
52
EFX_FILTER_PRI_REQUIRED
,
53
};
54
67
enum
efx_filter_flags
{
68
EFX_FILTER_FLAG_RX_RSS
= 0x01,
69
EFX_FILTER_FLAG_RX_SCATTER
= 0x02,
70
EFX_FILTER_FLAG_RX
= 0x08,
71
EFX_FILTER_FLAG_TX
= 0x10,
72
};
73
89
struct
efx_filter_spec
{
90
u8
type
:4;
91
u8
priority
:4;
92
u8
flags
;
93
u16
dmaq_id
;
94
u32
data
[3];
95
};
96
97
static
inline
void
efx_filter_init_rx(
struct
efx_filter_spec
*spec,
98
enum
efx_filter_priority
priority
,
99
enum
efx_filter_flags
flags
,
100
unsigned
rxq_id)
101
{
102
spec->
type
=
EFX_FILTER_UNSPEC
;
103
spec->
priority
=
priority
;
104
spec->
flags
=
EFX_FILTER_FLAG_RX
|
flags
;
105
spec->
dmaq_id
= rxq_id;
106
}
107
108
static
inline
void
efx_filter_init_tx(
struct
efx_filter_spec
*spec,
109
unsigned
txq_id)
110
{
111
spec->
type
=
EFX_FILTER_UNSPEC
;
112
spec->
priority
=
EFX_FILTER_PRI_REQUIRED
;
113
spec->
flags
=
EFX_FILTER_FLAG_TX
;
114
spec->
dmaq_id
= txq_id;
115
}
116
117
extern
int
efx_filter_set_ipv4_local
(
struct
efx_filter_spec
*spec,
u8
proto
,
118
__be32
host
,
__be16
port
);
119
extern
int
efx_filter_get_ipv4_local
(
const
struct
efx_filter_spec
*spec,
120
u8
*
proto
,
__be32
*
host
,
__be16
*
port
);
121
extern
int
efx_filter_set_ipv4_full
(
struct
efx_filter_spec
*spec,
u8
proto
,
122
__be32
host
,
__be16
port
,
123
__be32
rhost,
__be16
rport
);
124
extern
int
efx_filter_get_ipv4_full
(
const
struct
efx_filter_spec
*spec,
125
u8
*
proto
,
__be32
*
host
,
__be16
*
port
,
126
__be32
*rhost,
__be16
*
rport
);
127
extern
int
efx_filter_set_eth_local
(
struct
efx_filter_spec
*spec,
128
u16
vid
,
const
u8
*
addr
);
129
extern
int
efx_filter_get_eth_local
(
const
struct
efx_filter_spec
*spec,
130
u16
*
vid
,
u8
*
addr
);
131
extern
int
efx_filter_set_uc_def
(
struct
efx_filter_spec
*spec);
132
extern
int
efx_filter_set_mc_def
(
struct
efx_filter_spec
*spec);
133
enum
{
134
EFX_FILTER_VID_UNSPEC
= 0xffff,
135
};
136
137
#endif
/* EFX_FILTER_H */
Generated on Thu Jan 10 2013 14:04:54 for Linux Kernel by
1.8.2