Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90285
b: refs/heads/master
c: 835d3ac
h: refs/heads/master
i:
  90283: 592873d
v: v3
  • Loading branch information
Holger Schurig authored and John W. Linville committed Mar 25, 2008
1 parent 536302a commit e5f809c
Show file tree
Hide file tree
Showing 42 changed files with 518 additions and 791 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7cbca67c073263c179f605bdbbdc565ab29d801d
refs/heads/master: 835d3ac5e8cbe1fec2c02c7fc662586b30b1f5a8
31 changes: 6 additions & 25 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,24 +1200,6 @@ static void lbs_submit_command(struct lbs_private *priv,
lbs_deb_leave(LBS_DEB_HOST);
}

static int lbs_cmd_mac_control(struct lbs_private *priv,
struct cmd_ds_command *cmd)
{
struct cmd_ds_mac_control *mac = &cmd->params.macctrl;

lbs_deb_enter(LBS_DEB_CMD);

cmd->command = cpu_to_le16(CMD_MAC_CONTROL);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_mac_control) + S_DS_GEN);
mac->action = cpu_to_le16(priv->currentpacketfilter);

lbs_deb_cmd("MAC_CONTROL: action 0x%04x, size %d\n",
le16_to_cpu(mac->action), le16_to_cpu(cmd->size));

lbs_deb_leave(LBS_DEB_CMD);
return 0;
}

/**
* This function inserts command node to cmdfreeq
* after cleans it. Requires priv->driver_lock held.
Expand Down Expand Up @@ -1307,12 +1289,15 @@ int lbs_set_radio_control(struct lbs_private *priv)
int lbs_set_mac_packet_filter(struct lbs_private *priv)
{
int ret = 0;
struct cmd_ds_mac_control cmd;

lbs_deb_enter(LBS_DEB_CMD);

/* Send MAC control command to station */
ret = lbs_prepare_and_send_command(priv,
CMD_MAC_CONTROL, 0, 0, 0, NULL);
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(priv->currentpacketfilter);
cmd.reserved = 0;

ret = lbs_cmd_with_response(priv, CMD_MAC_CONTROL, &cmd);

lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret;
Expand Down Expand Up @@ -1382,10 +1367,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
ret = lbs_cmd_802_11_ps_mode(priv, cmdptr, cmd_action);
break;

case CMD_MAC_CONTROL:
ret = lbs_cmd_mac_control(priv, cmdptr);
break;

case CMD_802_11_ASSOCIATE:
case CMD_802_11_REASSOCIATE:
ret = lbs_cmd_80211_associate(priv, cmdptr, pdata_buf);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/libertas/cmdresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
break;

case CMD_RET(CMD_MAC_MULTICAST_ADR):
case CMD_RET(CMD_MAC_CONTROL):
case CMD_RET(CMD_802_11_RESET):
case CMD_RET(CMD_802_11_AUTHENTICATE):
case CMD_RET(CMD_802_11_BEACON_STOP):
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/libertas/hostcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ struct cmd_ds_802_11_get_log {
};

struct cmd_ds_mac_control {
struct cmd_header hdr;
__le16 action;
__le16 reserved;
u16 reserved;
};

struct cmd_ds_mac_multicast_adr {
Expand Down Expand Up @@ -695,7 +696,6 @@ struct cmd_ds_command {
/* command Body */
union {
struct cmd_ds_802_11_ps_mode psmode;
struct cmd_ds_mac_control macctrl;
struct cmd_ds_802_11_associate associate;
struct cmd_ds_802_11_deauthenticate deauth;
struct cmd_ds_802_11_ad_hoc_start ads;
Expand Down
11 changes: 0 additions & 11 deletions trunk/include/linux/in6.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,4 @@ struct in6_flowlabel_req
* IP6T_SO_GET_REVISION_TARGET 69
*/

/* RFC5014: Source address selection */
#define IPV6_ADDR_PREFERENCES 72

#define IPV6_PREFER_SRC_TMP 0x0001
#define IPV6_PREFER_SRC_PUBLIC 0x0002
#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
#define IPV6_PREFER_SRC_COA 0x0004
#define IPV6_PREFER_SRC_HOME 0x0400
#define IPV6_PREFER_SRC_CGA 0x0008
#define IPV6_PREFER_SRC_NONCGA 0x0800

#endif
39 changes: 8 additions & 31 deletions trunk/include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,29 +274,8 @@ struct ipv6_pinfo {

__be32 flow_label;
__u32 frag_size;

/*
* Packed in 16bits.
* Omit one shift by by putting the signed field at MSB.
*/
#if defined(__BIG_ENDIAN_BITFIELD)
__s16 hop_limit:9;
__u16 __unused_1:7;
#else
__u16 __unused_1:7;
__s16 hop_limit:9;
#endif

#if defined(__BIG_ENDIAN_BITFIELD)
/* Packed in 16bits. */
__s16 mcast_hops:9;
__u16 __unused_2:6,
mc_loop:1;
#else
__u16 mc_loop:1,
__unused_2:6;
__s16 mcast_hops:9;
#endif
__s16 hop_limit;
__s16 mcast_hops;
int mcast_oif;

/* pktoption flags */
Expand All @@ -319,14 +298,11 @@ struct ipv6_pinfo {
} rxopt;

/* sockopt flags */
__u8 recverr:1,
__u8 mc_loop:1,
recverr:1,
sndflow:1,
pmtudisc:2,
ipv6only:1,
srcprefs:3; /* 001: prefer temporary address
* 010: prefer public address
* 100: prefer care-of address
*/
ipv6only:1;
__u8 tclass;

__u32 dst_cookie;
Expand All @@ -339,8 +315,9 @@ struct ipv6_pinfo {
struct sk_buff *pktoptions;
struct {
struct ipv6_txoptions *opt;
u8 hop_limit;
u8 tclass;
struct rt6_info *rt;
int hop_limit;
int tclass;
} cork;
};

Expand Down
3 changes: 2 additions & 1 deletion trunk/include/net/addrconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,

extern int ipv6_dev_get_saddr(struct net_device *dev,
struct in6_addr *daddr,
unsigned int srcprefs,
struct in6_addr *saddr);
extern int ipv6_get_lladdr(struct net_device *dev,
struct in6_addr *addr,
Expand Down Expand Up @@ -124,6 +123,8 @@ extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

extern int ipv6_get_hoplimit(struct net_device *dev);

/*
* anycast prototypes (anycast.c)
*/
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/net/inet_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct inet_sock {
unsigned int flags;
unsigned int fragsize;
struct ip_options *opt;
struct dst_entry *dst;
struct rtable *rt;
int length; /* Total length of all frames */
__be32 addr;
struct flowi fl;
Expand Down
10 changes: 4 additions & 6 deletions trunk/include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,10 @@ extern int ip_forward(struct sk_buff *skb);
extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, __be32 daddr, struct rtable *rt, int is_frag);
extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb);
extern void ip_options_fragment(struct sk_buff *skb);
extern int ip_options_compile(struct net *net,
struct ip_options *opt, struct sk_buff *skb);
extern int ip_options_get(struct net *net, struct ip_options **optp,
extern int ip_options_compile(struct ip_options *opt, struct sk_buff *skb);
extern int ip_options_get(struct ip_options **optp,
unsigned char *data, int optlen);
extern int ip_options_get_from_user(struct net *net, struct ip_options **optp,
extern int ip_options_get_from_user(struct ip_options **optp,
unsigned char __user *data, int optlen);
extern void ip_options_undo(struct ip_options * opt);
extern void ip_forward_options(struct sk_buff *skb);
Expand All @@ -362,8 +361,7 @@ extern int ip_options_rcv_srr(struct sk_buff *skb);
*/

extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb);
extern int ip_cmsg_send(struct net *net,
struct msghdr *msg, struct ipcm_cookie *ipc);
extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc);
extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen);
extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen);
extern int compat_ip_setsockopt(struct sock *sk, int level,
Expand Down
11 changes: 3 additions & 8 deletions trunk/include/net/ip6_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ struct route_info {
#include <linux/ip.h>
#include <linux/ipv6.h>

#define RT6_LOOKUP_F_IFACE 0x00000001
#define RT6_LOOKUP_F_REACHABLE 0x00000002
#define RT6_LOOKUP_F_HAS_SADDR 0x00000004
#define RT6_LOOKUP_F_SRCPREF_TMP 0x00000008
#define RT6_LOOKUP_F_SRCPREF_PUBLIC 0x00000010
#define RT6_LOOKUP_F_SRCPREF_COA 0x00000020
#define RT6_LOOKUP_F_IFACE 0x1
#define RT6_LOOKUP_F_REACHABLE 0x2
#define RT6_LOOKUP_F_HAS_SADDR 0x4

extern struct rt6_info *ip6_null_entry;

Expand Down Expand Up @@ -91,8 +88,6 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
const struct in6_addr *addr,
int anycast);

extern int ip6_dst_hoplimit(struct dst_entry *dst);

/*
* support functions for ND
*
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/net/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ struct net_protocol {
int (*gso_send_check)(struct sk_buff *skb);
struct sk_buff *(*gso_segment)(struct sk_buff *skb,
int features);
unsigned int no_policy:1,
netns_ok:1;
int no_policy;
};

#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
Expand Down
17 changes: 0 additions & 17 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1045,23 +1045,6 @@ xfrm_address_t *xfrm_flowi_saddr(struct flowi *fl, unsigned short family)
return NULL;
}

static __inline__
void xfrm_flowi_addr_get(struct flowi *fl,
xfrm_address_t *saddr, xfrm_address_t *daddr,
unsigned short family)
{
switch(family) {
case AF_INET:
memcpy(&saddr->a4, &fl->fl4_src, sizeof(saddr->a4));
memcpy(&daddr->a4, &fl->fl4_dst, sizeof(daddr->a4));
break;
case AF_INET6:
ipv6_addr_copy((struct in6_addr *)&saddr->a6, &fl->fl6_src);
ipv6_addr_copy((struct in6_addr *)&daddr->a6, &fl->fl6_dst);
break;
}
}

static __inline__ int
__xfrm4_state_addr_check(struct xfrm_state *x,
xfrm_address_t *daddr, xfrm_address_t *saddr)
Expand Down
7 changes: 3 additions & 4 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,7 @@ static int ptype_seq_show(struct seq_file *seq, void *v)

if (v == SEQ_START_TOKEN)
seq_puts(seq, "Type Device Function\n");
else if (pt->dev == NULL || pt->dev->nd_net == seq_file_net(seq)) {
else {
if (pt->type == htons(ETH_P_ALL))
seq_puts(seq, "ALL ");
else
Expand All @@ -2639,16 +2639,15 @@ static const struct seq_operations ptype_seq_ops = {

static int ptype_seq_open(struct inode *inode, struct file *file)
{
return seq_open_net(inode, file, &ptype_seq_ops,
sizeof(struct seq_net_private));
return seq_open(file, &ptype_seq_ops);
}

static const struct file_operations ptype_seq_fops = {
.owner = THIS_MODULE,
.open = ptype_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_net,
.release = seq_release,
};


Expand Down
31 changes: 5 additions & 26 deletions trunk/net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,23 +243,6 @@ void build_ehash_secret(void)
}
EXPORT_SYMBOL(build_ehash_secret);

static inline int inet_netns_ok(struct net *net, int protocol)
{
int hash;
struct net_protocol *ipprot;

if (net == &init_net)
return 1;

hash = protocol & (MAX_INET_PROTOS - 1);
ipprot = rcu_dereference(inet_protos[hash]);

if (ipprot == NULL)
/* raw IP is OK */
return 1;
return ipprot->netns_ok;
}

/*
* Create an inet socket.
*/
Expand All @@ -276,6 +259,9 @@ static int inet_create(struct net *net, struct socket *sock, int protocol)
int try_loading_module = 0;
int err;

if (net != &init_net)
return -EAFNOSUPPORT;

if (sock->type != SOCK_RAW &&
sock->type != SOCK_DGRAM &&
!inet_ehash_secret)
Expand Down Expand Up @@ -334,10 +320,6 @@ static int inet_create(struct net *net, struct socket *sock, int protocol)
if (answer->capability > 0 && !capable(answer->capability))
goto out_rcu_unlock;

err = -EAFNOSUPPORT;
if (!inet_netns_ok(net, protocol))
goto out_rcu_unlock;

sock->ops = answer->ops;
answer_prot = answer->prot;
answer_no_check = answer->no_check;
Expand Down Expand Up @@ -464,7 +446,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (addr_len < sizeof(struct sockaddr_in))
goto out;

chk_addr_ret = inet_addr_type(sk->sk_net, addr->sin_addr.s_addr);
chk_addr_ret = inet_addr_type(&init_net, addr->sin_addr.s_addr);

/* Not specified by any standard per-se, however it breaks too
* many applications when removed. It is unfortunate since
Expand Down Expand Up @@ -1132,7 +1114,7 @@ int inet_sk_rebuild_header(struct sock *sk)
};

security_sk_classify_flow(sk, &fl);
err = ip_route_output_flow(sk->sk_net, &rt, &fl, sk, 0);
err = ip_route_output_flow(&init_net, &rt, &fl, sk, 0);
}
if (!err)
sk_setup_caps(sk, &rt->u.dst);
Expand Down Expand Up @@ -1302,20 +1284,17 @@ static struct net_protocol tcp_protocol = {
.gso_send_check = tcp_v4_gso_send_check,
.gso_segment = tcp_tso_segment,
.no_policy = 1,
.netns_ok = 1,
};

static struct net_protocol udp_protocol = {
.handler = udp_rcv,
.err_handler = udp_err,
.no_policy = 1,
.netns_ok = 1,
};

static struct net_protocol icmp_protocol = {
.handler = icmp_rcv,
.no_policy = 1,
.netns_ok = 1,
};

static int __init init_ipv4_mibs(void)
Expand Down
Loading

0 comments on commit e5f809c

Please sign in to comment.