git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
net
/
atm
/
mpc.c
diff --git
a/net/atm/mpc.c
b/net/atm/mpc.c
index
0070466
..
c18f737
100644
(file)
--- a/
net/atm/mpc.c
+++ b/
net/atm/mpc.c
@@
-98,11
+98,6
@@
static struct notifier_block mpoa_notifier = {
0
};
0
};
-#ifdef CONFIG_PROC_FS
-extern int mpc_proc_init(void);
-extern void mpc_proc_clean(void);
-#endif
-
struct mpoa_client *mpcs = NULL; /* FIXME */
static struct atm_mpoa_qos *qos_head = NULL;
static DEFINE_TIMER(mpc_timer, NULL, 0, 0);
struct mpoa_client *mpcs = NULL; /* FIXME */
static struct atm_mpoa_qos *qos_head = NULL;
static DEFINE_TIMER(mpc_timer, NULL, 0, 0);
@@
-157,7
+152,7
@@
static struct mpoa_client *find_mpc_by_lec(struct net_device *dev)
/*
* Overwrites the old entry or makes a new one.
*/
/*
* Overwrites the old entry or makes a new one.
*/
-struct atm_mpoa_qos *atm_mpoa_add_qos(
uint32_t
dst_ip, struct atm_qos *qos)
+struct atm_mpoa_qos *atm_mpoa_add_qos(
__be32
dst_ip, struct atm_qos *qos)
{
struct atm_mpoa_qos *entry;
{
struct atm_mpoa_qos *entry;
@@
-182,7
+177,7
@@
struct atm_mpoa_qos *atm_mpoa_add_qos(uint32_t dst_ip, struct atm_qos *qos)
return entry;
}
return entry;
}
-struct atm_mpoa_qos *atm_mpoa_search_qos(
uint32_t
dst_ip)
+struct atm_mpoa_qos *atm_mpoa_search_qos(
__be32
dst_ip)
{
struct atm_mpoa_qos *qos;
{
struct atm_mpoa_qos *qos;
@@
-465,11
+460,11
@@
static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
in_cache_entry *entry;
struct iphdr *iph;
char *buff;
in_cache_entry *entry;
struct iphdr *iph;
char *buff;
-
uint32_t
ipaddr = 0;
+
__be32
ipaddr = 0;
static struct {
struct llc_snap_hdr hdr;
static struct {
struct llc_snap_hdr hdr;
-
uint32_t
tag;
+
__be32
tag;
} tagged_llc_snap_hdr = {
{0xaa, 0xaa, 0x03, {0x00, 0x00, 0x00}, {0x88, 0x4c}},
0
} tagged_llc_snap_hdr = {
{0xaa, 0xaa, 0x03, {0x00, 0x00, 0x00}, {0x88, 0x4c}},
0
@@
-564,8
+559,7
@@
static int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
struct mpoa_client *mpc;
struct atmmpc_ioc ioc_data;
in_cache_entry *in_entry;
struct mpoa_client *mpc;
struct atmmpc_ioc ioc_data;
in_cache_entry *in_entry;
- uint32_t ipaddr;
- unsigned char *ip;
+ __be32 ipaddr;
bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmmpc_ioc));
if (bytes_left != 0) {
bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmmpc_ioc));
if (bytes_left != 0) {
@@
-588,9
+582,8
@@
static int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
if (in_entry != NULL) mpc->in_ops->put(in_entry);
return -EINVAL;
}
if (in_entry != NULL) mpc->in_ops->put(in_entry);
return -EINVAL;
}
- ip = (unsigned char*)&in_entry->ctrl_info.in_dst_ip;
printk("mpoa: (%s) mpc_vcc_attach: attaching ingress SVC, entry = %u.%u.%u.%u\n",
printk("mpoa: (%s) mpc_vcc_attach: attaching ingress SVC, entry = %u.%u.%u.%u\n",
- mpc->dev->name,
ip[0], ip[1], ip[2], ip[3]
);
+ mpc->dev->name,
NIPQUAD(in_entry->ctrl_info.in_dst_ip)
);
in_entry->shortcut = vcc;
mpc->in_ops->put(in_entry);
} else {
in_entry->shortcut = vcc;
mpc->in_ops->put(in_entry);
} else {
@@
-621,10
+614,8
@@
static void mpc_vcc_close(struct atm_vcc *vcc, struct net_device *dev)
dprintk("mpoa: (%s) mpc_vcc_close:\n", dev->name);
in_entry = mpc->in_ops->get_by_vcc(vcc, mpc);
if (in_entry) {
dprintk("mpoa: (%s) mpc_vcc_close:\n", dev->name);
in_entry = mpc->in_ops->get_by_vcc(vcc, mpc);
if (in_entry) {
- unsigned char *ip __attribute__ ((unused)) =
- (unsigned char *)&in_entry->ctrl_info.in_dst_ip;
dprintk("mpoa: (%s) mpc_vcc_close: ingress SVC closed ip = %u.%u.%u.%u\n",
dprintk("mpoa: (%s) mpc_vcc_close: ingress SVC closed ip = %u.%u.%u.%u\n",
- mpc->dev->name,
ip[0], ip[1], ip[2], ip[3]
);
+ mpc->dev->name,
NIPQUAD(in_entry->ctrl_info.in_dst_ip)
);
in_entry->shortcut = NULL;
mpc->in_ops->put(in_entry);
}
in_entry->shortcut = NULL;
mpc->in_ops->put(in_entry);
}
@@
-647,7
+638,7
@@
static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
struct sk_buff *new_skb;
eg_cache_entry *eg;
struct mpoa_client *mpc;
struct sk_buff *new_skb;
eg_cache_entry *eg;
struct mpoa_client *mpc;
-
uint32_t
tag;
+
__be32
tag;
char *tmp;
ddprintk("mpoa: (%s) mpc_push:\n", dev->name);
char *tmp;
ddprintk("mpoa: (%s) mpc_push:\n", dev->name);
@@
-692,7
+683,7
@@
static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
}
tmp = skb->data + sizeof(struct llc_snap_hdr);
}
tmp = skb->data + sizeof(struct llc_snap_hdr);
- tag = *(
uint32_t
*)tmp;
+ tag = *(
__be32
*)tmp;
eg = mpc->eg_ops->get_by_tag(tag, mpc);
if (eg == NULL) {
eg = mpc->eg_ops->get_by_tag(tag, mpc);
if (eg == NULL) {
@@
-1038,7
+1029,7
@@
static int mpoa_event_listener(struct notifier_block *mpoa_notifier, unsigned lo
static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
-
uint32_t
dst_ip = msg->content.in_info.in_dst_ip;
+
__be32
dst_ip = msg->content.in_info.in_dst_ip;
in_cache_entry *entry;
entry = mpc->in_ops->get(dst_ip, mpc);
in_cache_entry *entry;
entry = mpc->in_ops->get(dst_ip, mpc);
@@
-1075,7
+1066,7
@@
static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc)
*/
static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_client *client, in_cache_entry *entry)
{
*/
static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_client *client, in_cache_entry *entry)
{
-
uint32_t
dst_ip = msg->content.in_info.in_dst_ip;
+
__be32
dst_ip = msg->content.in_info.in_dst_ip;
struct atm_mpoa_qos *qos = atm_mpoa_search_qos(dst_ip);
eg_cache_entry *eg_entry = client->eg_ops->get_by_src_ip(dst_ip, client);
struct atm_mpoa_qos *qos = atm_mpoa_search_qos(dst_ip);
eg_cache_entry *eg_entry = client->eg_ops->get_by_src_ip(dst_ip, client);
@@
-1111,7
+1102,7
@@
static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_clien
static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
-
uint32_t
dst_ip = msg->content.in_info.in_dst_ip;
+
__be32
dst_ip = msg->content.in_info.in_dst_ip;
in_cache_entry *entry = mpc->in_ops->get(dst_ip, mpc);
dprintk("mpoa: (%s) MPOA_res_reply_rcvd: ip %u.%u.%u.%u\n", mpc->dev->name, NIPQUAD(dst_ip));
in_cache_entry *entry = mpc->in_ops->get(dst_ip, mpc);
dprintk("mpoa: (%s) MPOA_res_reply_rcvd: ip %u.%u.%u.%u\n", mpc->dev->name, NIPQUAD(dst_ip));
@@
-1157,20
+1148,19
@@
static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc)
static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
- uint32_t dst_ip = msg->content.in_info.in_dst_ip;
- uint32_t mask = msg->ip_mask;
- unsigned char *ip = (unsigned char *)&dst_ip;
+ __be32 dst_ip = msg->content.in_info.in_dst_ip;
+ __be32 mask = msg->ip_mask;
in_cache_entry *entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask);
if(entry == NULL){
printk("mpoa: (%s) ingress_purge_rcvd: purge for a non-existing entry, ", mpc->dev->name);
in_cache_entry *entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask);
if(entry == NULL){
printk("mpoa: (%s) ingress_purge_rcvd: purge for a non-existing entry, ", mpc->dev->name);
- printk("ip = %u.%u.%u.%u\n",
ip[0], ip[1], ip[2], ip[3]
);
+ printk("ip = %u.%u.%u.%u\n",
NIPQUAD(dst_ip)
);
return;
}
do {
dprintk("mpoa: (%s) ingress_purge_rcvd: removing an ingress entry, ip = %u.%u.%u.%u\n" ,
return;
}
do {
dprintk("mpoa: (%s) ingress_purge_rcvd: removing an ingress entry, ip = %u.%u.%u.%u\n" ,
- mpc->dev->name,
ip[0], ip[1], ip[2], ip[3]
);
+ mpc->dev->name,
NIPQUAD(dst_ip)
);
write_lock_bh(&mpc->ingress_lock);
mpc->in_ops->remove_entry(entry, mpc);
write_unlock_bh(&mpc->ingress_lock);
write_lock_bh(&mpc->ingress_lock);
mpc->in_ops->remove_entry(entry, mpc);
write_unlock_bh(&mpc->ingress_lock);
@@
-1183,7
+1173,7
@@
static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)
{
-
uint32_t
cache_id = msg->content.eg_info.cache_id;
+
__be32
cache_id = msg->content.eg_info.cache_id;
eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc);
if (entry == NULL) {
eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc);
if (entry == NULL) {
@@
-1332,13
+1322,12
@@
static void set_mps_mac_addr_rcvd(struct k_message *msg, struct mpoa_client *cli
if(client->number_of_mps_macs)
kfree(client->mps_macs);
client->number_of_mps_macs = 0;
if(client->number_of_mps_macs)
kfree(client->mps_macs);
client->number_of_mps_macs = 0;
- client->mps_macs = km
alloc(ETH_ALEN,
GFP_KERNEL);
+ client->mps_macs = km
emdup(msg->MPS_ctrl, ETH_ALEN,
GFP_KERNEL);
if (client->mps_macs == NULL) {
printk("mpoa: set_mps_mac_addr_rcvd: out of memory\n");
return;
}
client->number_of_mps_macs = 1;
if (client->mps_macs == NULL) {
printk("mpoa: set_mps_mac_addr_rcvd: out of memory\n");
return;
}
client->number_of_mps_macs = 1;
- memcpy(client->mps_macs, msg->MPS_ctrl, ETH_ALEN);
return;
}
return;
}
@@
-1439,12
+1428,8
@@
static __init int atm_mpoa_init(void)
{
register_atm_ioctl(&atm_ioctl_ops);
{
register_atm_ioctl(&atm_ioctl_ops);
-#ifdef CONFIG_PROC_FS
if (mpc_proc_init() != 0)
printk(KERN_INFO "mpoa: failed to initialize /proc/mpoa\n");
if (mpc_proc_init() != 0)
printk(KERN_INFO "mpoa: failed to initialize /proc/mpoa\n");
- else
- printk(KERN_INFO "mpoa: /proc/mpoa initialized\n");
-#endif
printk("mpc.c: " __DATE__ " " __TIME__ " initialized\n");
printk("mpc.c: " __DATE__ " " __TIME__ " initialized\n");
@@
-1457,9
+1442,7
@@
static void __exit atm_mpoa_cleanup(void)
struct atm_mpoa_qos *qos, *nextqos;
struct lec_priv *priv;
struct atm_mpoa_qos *qos, *nextqos;
struct lec_priv *priv;
-#ifdef CONFIG_PROC_FS
mpc_proc_clean();
mpc_proc_clean();
-#endif
del_timer(&mpc_timer);
unregister_netdevice_notifier(&mpoa_notifier);
del_timer(&mpc_timer);
unregister_netdevice_notifier(&mpoa_notifier);