blob: e705b27ec7dc133c7920f6a50d7a71a2a2204ca2 [file] [log] [blame]
Frank Blaschka4a71df52008-02-15 09:19:42 +01001/*
2 * drivers/s390/net/qeth_l3.h
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Utz Bacher <utz.bacher@de.ibm.com>,
6 * Frank Pavlic <fpavlic@de.ibm.com>,
7 * Thomas Spatzier <tspat@de.ibm.com>,
8 * Frank Blaschka <frank.blaschka@de.ibm.com>
9 */
10
11#ifndef __QETH_L3_H__
12#define __QETH_L3_H__
13
14#include "qeth_core.h"
15
Ursula Braun76b11f82010-01-11 02:50:50 +000016#define QETH_SNIFF_AVAIL 0x0008
17
Frank Blaschka4a71df52008-02-15 09:19:42 +010018struct qeth_ipaddr {
19 struct list_head entry;
20 enum qeth_ip_types type;
21 enum qeth_ipa_setdelip_flags set_flags;
22 enum qeth_ipa_setdelip_flags del_flags;
23 int is_multicast;
24 int users;
25 enum qeth_prot_versions proto;
26 unsigned char mac[OSA_ADDR_LEN];
27 union {
28 struct {
29 unsigned int addr;
30 unsigned int mask;
31 } a4;
32 struct {
33 struct in6_addr addr;
34 unsigned int pfxlen;
35 } a6;
36 } u;
37};
38
39struct qeth_ipato_entry {
40 struct list_head entry;
41 enum qeth_prot_versions proto;
42 char addr[16];
43 int mask_bits;
44};
45
46
47void qeth_l3_ipaddr4_to_string(const __u8 *, char *);
48int qeth_l3_string_to_ipaddr4(const char *, __u8 *);
49void qeth_l3_ipaddr6_to_string(const __u8 *, char *);
50int qeth_l3_string_to_ipaddr6(const char *, __u8 *);
51void qeth_l3_ipaddr_to_string(enum qeth_prot_versions, const __u8 *, char *);
52int qeth_l3_string_to_ipaddr(const char *, enum qeth_prot_versions, __u8 *);
53int qeth_l3_create_device_attributes(struct device *);
54void qeth_l3_remove_device_attributes(struct device *);
55int qeth_l3_setrouting_v4(struct qeth_card *);
56int qeth_l3_setrouting_v6(struct qeth_card *);
57int qeth_l3_add_ipato_entry(struct qeth_card *, struct qeth_ipato_entry *);
58void qeth_l3_del_ipato_entry(struct qeth_card *, enum qeth_prot_versions,
59 u8 *, int);
60int qeth_l3_add_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
61void qeth_l3_del_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
62int qeth_l3_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
63void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions,
64 const u8 *);
Frank Blaschkac3b4a742009-11-12 00:11:44 +000065int qeth_l3_set_large_send(struct qeth_card *, enum qeth_large_send_types);
Frank Blaschka3fd434d2009-11-12 00:11:45 +000066int qeth_l3_set_rx_csum(struct qeth_card *, enum qeth_checksum_types);
Klaus-Dieter Wacker62982632010-07-22 23:15:03 +000067int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *, struct qeth_ipaddr *);
Frank Blaschka4a71df52008-02-15 09:19:42 +010068
69#endif /* __QETH_L3_H__ */