Commit e098556b authored by Shmulik Hen's avatar Shmulik Hen Committed by Jeff Garzik

[PATCH] bonding cleanup 2.6 - death of typedefs

Eliminate bonding_t/slave_t types and consolidate casting.
parent 7987c426
...@@ -2356,8 +2356,8 @@ int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info) ...@@ -2356,8 +2356,8 @@ int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
{ {
slave_t *slave, *start_at; struct slave *slave, *start_at;
struct bonding *bond = (struct bonding *) dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
struct ethhdr *data = (struct ethhdr *)skb->data; struct ethhdr *data = (struct ethhdr *)skb->data;
int slave_agg_no; int slave_agg_no;
int slaves_in_agg; int slaves_in_agg;
...@@ -2379,7 +2379,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2379,7 +2379,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
slave = bond->prev; slave = bond->prev;
/* check if bond is empty */ /* check if bond is empty */
if ((slave == (struct slave *) bond) || (bond->slave_cnt == 0)) { if ((slave == (struct slave *)bond) || (bond->slave_cnt == 0)) {
printk(KERN_DEBUG DRV_NAME ": Error: bond is empty\n"); printk(KERN_DEBUG DRV_NAME ": Error: bond is empty\n");
dev_kfree_skb(skb); dev_kfree_skb(skb);
read_unlock(&bond->lock); read_unlock(&bond->lock);
...@@ -2413,7 +2413,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2413,7 +2413,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
} }
slave_agg_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % slaves_in_agg; slave_agg_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % slaves_in_agg;
while (slave != (slave_t *)bond) { while (slave != (struct slave *)bond) {
struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
if (agg && (agg->aggregator_identifier == agg_id)) { if (agg && (agg->aggregator_identifier == agg_id)) {
...@@ -2432,7 +2432,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2432,7 +2432,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
} }
} }
if (slave == (slave_t *)bond) { if (slave == (struct slave *)bond) {
printk(KERN_ERR DRV_NAME ": Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id); printk(KERN_ERR DRV_NAME ": Error: Couldn't find a slave to tx on for aggregator ID %d\n", agg_id);
dev_kfree_skb(skb); dev_kfree_skb(skb);
read_unlock(&bond->lock); read_unlock(&bond->lock);
......
...@@ -257,7 +257,7 @@ tlb_deinitialize(struct bonding *bond) ...@@ -257,7 +257,7 @@ tlb_deinitialize(struct bonding *bond)
} }
/* Caller must hold bond lock for read */ /* Caller must hold bond lock for read */
static struct slave* static struct slave *
tlb_get_least_loaded_slave(struct bonding *bond) tlb_get_least_loaded_slave(struct bonding *bond)
{ {
struct slave *slave; struct slave *slave;
...@@ -299,7 +299,7 @@ tlb_get_least_loaded_slave(struct bonding *bond) ...@@ -299,7 +299,7 @@ tlb_get_least_loaded_slave(struct bonding *bond)
} }
/* Caller must hold bond lock for read */ /* Caller must hold bond lock for read */
struct slave* struct slave *
tlb_choose_channel(struct bonding *bond, u32 hash_index, u32 skb_len) tlb_choose_channel(struct bonding *bond, u32 hash_index, u32 skb_len)
{ {
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
...@@ -397,7 +397,7 @@ rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) ...@@ -397,7 +397,7 @@ rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
static int static int
rlb_arp_recv(struct sk_buff *skb, rlb_arp_recv(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type* ptype) struct packet_type *ptype)
{ {
struct bonding *bond = (struct bonding *)dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
int ret = NET_RX_DROP; int ret = NET_RX_DROP;
...@@ -432,7 +432,7 @@ rlb_arp_recv(struct sk_buff *skb, ...@@ -432,7 +432,7 @@ rlb_arp_recv(struct sk_buff *skb,
} }
/* Caller must hold bond lock for read */ /* Caller must hold bond lock for read */
static struct slave* static struct slave *
rlb_next_rx_slave(struct bonding *bond) rlb_next_rx_slave(struct bonding *bond)
{ {
struct slave *rx_slave = NULL, *slave = NULL; struct slave *rx_slave = NULL, *slave = NULL;
...@@ -607,7 +607,7 @@ rlb_req_update_slave_clients(struct bonding *bond, struct slave *slave) ...@@ -607,7 +607,7 @@ rlb_req_update_slave_clients(struct bonding *bond, struct slave *slave)
u8 ntt = 0; u8 ntt = 0;
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
struct rlb_client_info* client_info = NULL; struct rlb_client_info *client_info = NULL;
_lock_rx_hashtbl(bond); _lock_rx_hashtbl(bond);
...@@ -680,7 +680,7 @@ rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) ...@@ -680,7 +680,7 @@ rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip)
} }
/* Caller must hold both bond and ptr locks for read */ /* Caller must hold both bond and ptr locks for read */
struct slave* struct slave *
rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp)
{ {
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
...@@ -768,7 +768,7 @@ rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) ...@@ -768,7 +768,7 @@ rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp)
* does not choose channel for other arp types since they are * does not choose channel for other arp types since they are
* sent on the current_slave * sent on the current_slave
*/ */
static struct slave* static struct slave *
rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
{ {
struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw; struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw;
...@@ -1287,7 +1287,7 @@ bond_alb_deinitialize(struct bonding *bond) ...@@ -1287,7 +1287,7 @@ bond_alb_deinitialize(struct bonding *bond)
int int
bond_alb_xmit(struct sk_buff *skb, struct net_device *dev) bond_alb_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct bonding *bond = (struct bonding *) dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
struct ethhdr *eth_data = (struct ethhdr *)skb->data; struct ethhdr *eth_data = (struct ethhdr *)skb->data;
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
struct slave *tx_slave = NULL; struct slave *tx_slave = NULL;
...@@ -1652,7 +1652,7 @@ bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave) ...@@ -1652,7 +1652,7 @@ bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave)
int int
bond_alb_set_mac_address(struct net_device *dev, void *addr) bond_alb_set_mac_address(struct net_device *dev, void *addr)
{ {
struct bonding *bond = dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
struct sockaddr *sa = addr; struct sockaddr *sa = addr;
struct slave *swap_slave = NULL; struct slave *swap_slave = NULL;
int error = 0; int error = 0;
......
...@@ -593,14 +593,14 @@ static void bond_mii_monitor(struct net_device *dev); ...@@ -593,14 +593,14 @@ static void bond_mii_monitor(struct net_device *dev);
static void loadbalance_arp_monitor(struct net_device *dev); static void loadbalance_arp_monitor(struct net_device *dev);
static void activebackup_arp_monitor(struct net_device *dev); static void activebackup_arp_monitor(struct net_device *dev);
static void bond_mc_list_destroy(struct bonding *bond); static void bond_mc_list_destroy(struct bonding *bond);
static void bond_mc_add(bonding_t *bond, void *addr, int alen); static void bond_mc_add(struct bonding *bond, void *addr, int alen);
static void bond_mc_delete(bonding_t *bond, void *addr, int alen); static void bond_mc_delete(struct bonding *bond, void *addr, int alen);
static int bond_mc_list_copy (struct dev_mc_list *src, struct bonding *dst, int gpf_flag); static int bond_mc_list_copy (struct dev_mc_list *src, struct bonding *dst, int gpf_flag);
static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2); static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2);
static void bond_set_promiscuity(bonding_t *bond, int inc); static void bond_set_promiscuity(struct bonding *bond, int inc);
static void bond_set_allmulti(bonding_t *bond, int inc); static void bond_set_allmulti(struct bonding *bond, int inc);
static struct dev_mc_list* bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct dev_mc_list *mc_list); static struct dev_mc_list *bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct dev_mc_list *mc_list);
static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old); static void bond_mc_update(struct bonding *bond, struct slave *new, struct slave *old);
static int bond_enslave(struct net_device *master, struct net_device *slave); static int bond_enslave(struct net_device *master, struct net_device *slave);
static int bond_release(struct net_device *master, struct net_device *slave); static int bond_release(struct net_device *master, struct net_device *slave);
static int bond_release_all(struct net_device *master); static int bond_release_all(struct net_device *master);
...@@ -610,7 +610,7 @@ static void reselect_active_interface(struct bonding *bond); ...@@ -610,7 +610,7 @@ static void reselect_active_interface(struct bonding *bond);
static struct slave *find_best_interface(struct bonding *bond); static struct slave *find_best_interface(struct bonding *bond);
static void arp_send_all(slave_t *slave) static void arp_send_all(struct slave *slave)
{ {
int i; int i;
...@@ -660,13 +660,13 @@ multicast_mode_name(void) ...@@ -660,13 +660,13 @@ multicast_mode_name(void)
} }
} }
void bond_set_slave_inactive_flags(slave_t *slave) void bond_set_slave_inactive_flags(struct slave *slave)
{ {
slave->state = BOND_STATE_BACKUP; slave->state = BOND_STATE_BACKUP;
slave->dev->flags |= IFF_NOARP; slave->dev->flags |= IFF_NOARP;
} }
void bond_set_slave_active_flags(slave_t *slave) void bond_set_slave_active_flags(struct slave *slave)
{ {
slave->state = BOND_STATE_ACTIVE; slave->state = BOND_STATE_ACTIVE;
slave->dev->flags &= ~IFF_NOARP; slave->dev->flags &= ~IFF_NOARP;
...@@ -680,13 +680,13 @@ void bond_set_slave_active_flags(slave_t *slave) ...@@ -680,13 +680,13 @@ void bond_set_slave_active_flags(slave_t *slave)
* consistency check. * consistency check.
*/ */
static inline void static inline void
update_slave_cnt(bonding_t *bond, int incr) update_slave_cnt(struct bonding *bond, int incr)
{ {
slave_t *slave = NULL; struct slave *slave = NULL;
int expect = bond->slave_cnt + incr; int expect = bond->slave_cnt + incr;
bond->slave_cnt = 0; bond->slave_cnt = 0;
for (slave = bond->prev; slave != (slave_t*)bond; for (slave = bond->prev; slave != (struct slave *)bond;
slave = slave->prev) { slave = slave->prev) {
bond->slave_cnt++; bond->slave_cnt++;
} }
...@@ -705,8 +705,8 @@ update_slave_cnt(bonding_t *bond, int incr) ...@@ -705,8 +705,8 @@ update_slave_cnt(bonding_t *bond, int incr)
* *
* bond->lock held for writing by caller. * bond->lock held for writing by caller.
*/ */
static slave_t * static struct slave *
bond_detach_slave(bonding_t *bond, slave_t *slave) bond_detach_slave(struct bonding *bond, struct slave *slave)
{ {
if ((bond == NULL) || (slave == NULL) || if ((bond == NULL) || (slave == NULL) ||
((void *)bond == (void *)slave)) { ((void *)bond == (void *)slave)) {
...@@ -718,10 +718,10 @@ bond_detach_slave(bonding_t *bond, slave_t *slave) ...@@ -718,10 +718,10 @@ bond_detach_slave(bonding_t *bond, slave_t *slave)
if (bond->next == slave) { /* is the slave at the head ? */ if (bond->next == slave) { /* is the slave at the head ? */
if (bond->prev == slave) { /* is the slave alone ? */ if (bond->prev == slave) { /* is the slave alone ? */
bond->prev = bond->next = (slave_t *)bond; bond->prev = bond->next = (struct slave *)bond;
} else { /* not alone */ } else { /* not alone */
bond->next = slave->next; bond->next = slave->next;
slave->next->prev = (slave_t *)bond; slave->next->prev = (struct slave *)bond;
bond->prev->next = slave->next; bond->prev->next = slave->next;
} }
} else { } else {
...@@ -918,7 +918,7 @@ bond_check_dev_link(struct net_device *dev, int reporting) ...@@ -918,7 +918,7 @@ bond_check_dev_link(struct net_device *dev, int reporting)
return reporting ? -1 : BMSR_LSTATUS; return reporting ? -1 : BMSR_LSTATUS;
} }
static u16 bond_check_mii_link(bonding_t *bond) static u16 bond_check_mii_link(struct bonding *bond)
{ {
int has_active_interface = 0; int has_active_interface = 0;
...@@ -934,7 +934,7 @@ static u16 bond_check_mii_link(bonding_t *bond) ...@@ -934,7 +934,7 @@ static u16 bond_check_mii_link(bonding_t *bond)
/* register to receive lacpdus on a bond */ /* register to receive lacpdus on a bond */
static void bond_register_lacpdu(struct bonding *bond) static void bond_register_lacpdu(struct bonding *bond)
{ {
struct packet_type* pk_type = &(BOND_AD_INFO(bond).ad_pkt_type); struct packet_type *pk_type = &(BOND_AD_INFO(bond).ad_pkt_type);
/* initialize packet type */ /* initialize packet type */
pk_type->type = PKT_TYPE_LACPDU; pk_type->type = PKT_TYPE_LACPDU;
...@@ -952,9 +952,9 @@ static void bond_unregister_lacpdu(struct bonding *bond) ...@@ -952,9 +952,9 @@ static void bond_unregister_lacpdu(struct bonding *bond)
static int bond_open(struct net_device *dev) static int bond_open(struct net_device *dev)
{ {
struct bonding *bond = (struct bonding *)(dev->priv); struct bonding *bond = (struct bonding *)dev->priv;
struct timer_list *timer = &((struct bonding *)(dev->priv))->mii_timer; struct timer_list *timer = &bond->mii_timer;
struct timer_list *arp_timer = &((struct bonding *)(dev->priv))->arp_timer; struct timer_list *arp_timer = &bond->arp_timer;
if ((bond_mode == BOND_MODE_TLB) || if ((bond_mode == BOND_MODE_TLB) ||
(bond_mode == BOND_MODE_ALB)) { (bond_mode == BOND_MODE_ALB)) {
...@@ -1012,7 +1012,7 @@ static int bond_open(struct net_device *dev) ...@@ -1012,7 +1012,7 @@ static int bond_open(struct net_device *dev)
static int bond_close(struct net_device *master) static int bond_close(struct net_device *master)
{ {
bonding_t *bond = (struct bonding *) master->priv; struct bonding *bond = (struct bonding *)master->priv;
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
...@@ -1087,9 +1087,9 @@ static void bond_mc_list_destroy(struct bonding *bond) ...@@ -1087,9 +1087,9 @@ static void bond_mc_list_destroy(struct bonding *bond)
/* /*
* Add a Multicast address to every slave in the bonding group * Add a Multicast address to every slave in the bonding group
*/ */
static void bond_mc_add(bonding_t *bond, void *addr, int alen) static void bond_mc_add(struct bonding *bond, void *addr, int alen)
{ {
slave_t *slave; struct slave *slave;
switch (multicast_mode) { switch (multicast_mode) {
case BOND_MULTICAST_ACTIVE : case BOND_MULTICAST_ACTIVE :
/* write lock already acquired */ /* write lock already acquired */
...@@ -1097,7 +1097,7 @@ static void bond_mc_add(bonding_t *bond, void *addr, int alen) ...@@ -1097,7 +1097,7 @@ static void bond_mc_add(bonding_t *bond, void *addr, int alen)
dev_mc_add(bond->current_slave->dev, addr, alen, 0); dev_mc_add(bond->current_slave->dev, addr, alen, 0);
break; break;
case BOND_MULTICAST_ALL : case BOND_MULTICAST_ALL :
for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev) for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev)
dev_mc_add(slave->dev, addr, alen, 0); dev_mc_add(slave->dev, addr, alen, 0);
break; break;
case BOND_MULTICAST_DISABLED : case BOND_MULTICAST_DISABLED :
...@@ -1108,9 +1108,9 @@ static void bond_mc_add(bonding_t *bond, void *addr, int alen) ...@@ -1108,9 +1108,9 @@ static void bond_mc_add(bonding_t *bond, void *addr, int alen)
/* /*
* Remove a multicast address from every slave in the bonding group * Remove a multicast address from every slave in the bonding group
*/ */
static void bond_mc_delete(bonding_t *bond, void *addr, int alen) static void bond_mc_delete(struct bonding *bond, void *addr, int alen)
{ {
slave_t *slave; struct slave *slave;
switch (multicast_mode) { switch (multicast_mode) {
case BOND_MULTICAST_ACTIVE : case BOND_MULTICAST_ACTIVE :
/* write lock already acquired */ /* write lock already acquired */
...@@ -1118,7 +1118,7 @@ static void bond_mc_delete(bonding_t *bond, void *addr, int alen) ...@@ -1118,7 +1118,7 @@ static void bond_mc_delete(bonding_t *bond, void *addr, int alen)
dev_mc_delete(bond->current_slave->dev, addr, alen, 0); dev_mc_delete(bond->current_slave->dev, addr, alen, 0);
break; break;
case BOND_MULTICAST_ALL : case BOND_MULTICAST_ALL :
for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev) for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev)
dev_mc_delete(slave->dev, addr, alen, 0); dev_mc_delete(slave->dev, addr, alen, 0);
break; break;
case BOND_MULTICAST_DISABLED : case BOND_MULTICAST_DISABLED :
...@@ -1164,9 +1164,9 @@ static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2) ...@@ -1164,9 +1164,9 @@ static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2)
/* /*
* Push the promiscuity flag down to appropriate slaves * Push the promiscuity flag down to appropriate slaves
*/ */
static void bond_set_promiscuity(bonding_t *bond, int inc) static void bond_set_promiscuity(struct bonding *bond, int inc)
{ {
slave_t *slave; struct slave *slave;
if (USES_PRIMARY(bond_mode)) { if (USES_PRIMARY(bond_mode)) {
if (bond->current_slave) { if (bond->current_slave) {
...@@ -1174,7 +1174,7 @@ static void bond_set_promiscuity(bonding_t *bond, int inc) ...@@ -1174,7 +1174,7 @@ static void bond_set_promiscuity(bonding_t *bond, int inc)
} }
} else { } else {
for (slave = bond->prev; slave != (slave_t*)bond; for (slave = bond->prev; slave != (struct slave *)bond;
slave = slave->prev) { slave = slave->prev) {
dev_set_promiscuity(slave->dev, inc); dev_set_promiscuity(slave->dev, inc);
} }
...@@ -1184,9 +1184,9 @@ static void bond_set_promiscuity(bonding_t *bond, int inc) ...@@ -1184,9 +1184,9 @@ static void bond_set_promiscuity(bonding_t *bond, int inc)
/* /*
* Push the allmulti flag down to all slaves * Push the allmulti flag down to all slaves
*/ */
static void bond_set_allmulti(bonding_t *bond, int inc) static void bond_set_allmulti(struct bonding *bond, int inc)
{ {
slave_t *slave; struct slave *slave;
switch (multicast_mode) { switch (multicast_mode) {
case BOND_MULTICAST_ACTIVE : case BOND_MULTICAST_ACTIVE :
/* write lock already acquired */ /* write lock already acquired */
...@@ -1194,7 +1194,7 @@ static void bond_set_allmulti(bonding_t *bond, int inc) ...@@ -1194,7 +1194,7 @@ static void bond_set_allmulti(bonding_t *bond, int inc)
dev_set_allmulti(bond->current_slave->dev, inc); dev_set_allmulti(bond->current_slave->dev, inc);
break; break;
case BOND_MULTICAST_ALL : case BOND_MULTICAST_ALL :
for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev) for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev)
dev_set_allmulti(slave->dev, inc); dev_set_allmulti(slave->dev, inc);
break; break;
case BOND_MULTICAST_DISABLED : case BOND_MULTICAST_DISABLED :
...@@ -1205,7 +1205,7 @@ static void bond_set_allmulti(bonding_t *bond, int inc) ...@@ -1205,7 +1205,7 @@ static void bond_set_allmulti(bonding_t *bond, int inc)
/* /*
* returns dmi entry if found, NULL otherwise * returns dmi entry if found, NULL otherwise
*/ */
static struct dev_mc_list* bond_mc_list_find_dmi(struct dev_mc_list *dmi, static struct dev_mc_list *bond_mc_list_find_dmi(struct dev_mc_list *dmi,
struct dev_mc_list *mc_list) struct dev_mc_list *mc_list)
{ {
struct dev_mc_list *idmi; struct dev_mc_list *idmi;
...@@ -1220,7 +1220,7 @@ static struct dev_mc_list* bond_mc_list_find_dmi(struct dev_mc_list *dmi, ...@@ -1220,7 +1220,7 @@ static struct dev_mc_list* bond_mc_list_find_dmi(struct dev_mc_list *dmi,
static void set_multicast_list(struct net_device *master) static void set_multicast_list(struct net_device *master)
{ {
bonding_t *bond = master->priv; struct bonding *bond = (struct bonding *)master->priv;
struct dev_mc_list *dmi; struct dev_mc_list *dmi;
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
...@@ -1274,7 +1274,7 @@ static void set_multicast_list(struct net_device *master) ...@@ -1274,7 +1274,7 @@ static void set_multicast_list(struct net_device *master)
* old active slaves (if any) according to the multicast mode, and * old active slaves (if any) according to the multicast mode, and
* promiscuous flags unconditionally. * promiscuous flags unconditionally.
*/ */
static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old) static void bond_mc_update(struct bonding *bond, struct slave *new, struct slave *old)
{ {
struct dev_mc_list *dmi; struct dev_mc_list *dmi;
...@@ -1318,8 +1318,8 @@ static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old) ...@@ -1318,8 +1318,8 @@ static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old)
static int bond_enslave(struct net_device *master_dev, static int bond_enslave(struct net_device *master_dev,
struct net_device *slave_dev) struct net_device *slave_dev)
{ {
bonding_t *bond = NULL; struct bonding *bond = NULL;
slave_t *new_slave = NULL; struct slave *new_slave = NULL;
unsigned long rflags = 0; unsigned long rflags = 0;
int err = 0; int err = 0;
struct dev_mc_list *dmi; struct dev_mc_list *dmi;
...@@ -1331,7 +1331,7 @@ static int bond_enslave(struct net_device *master_dev, ...@@ -1331,7 +1331,7 @@ static int bond_enslave(struct net_device *master_dev,
if (master_dev == NULL || slave_dev == NULL) { if (master_dev == NULL || slave_dev == NULL) {
return -ENODEV; return -ENODEV;
} }
bond = (struct bonding *) master_dev->priv; bond = (struct bonding *)master_dev->priv;
if (slave_dev->do_ioctl == NULL) { if (slave_dev->do_ioctl == NULL) {
printk(KERN_WARNING DRV_NAME printk(KERN_WARNING DRV_NAME
...@@ -1395,10 +1395,10 @@ static int bond_enslave(struct net_device *master_dev, ...@@ -1395,10 +1395,10 @@ static int bond_enslave(struct net_device *master_dev,
} }
} }
if ((new_slave = kmalloc(sizeof(slave_t), GFP_KERNEL)) == NULL) { if ((new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL)) == NULL) {
return -ENOMEM; return -ENOMEM;
} }
memset(new_slave, 0, sizeof(slave_t)); memset(new_slave, 0, sizeof(struct slave));
/* save slave's original flags before calling /* save slave's original flags before calling
* netdev_set_master and dev_open * netdev_set_master and dev_open
...@@ -1718,10 +1718,10 @@ static int bond_enslave(struct net_device *master_dev, ...@@ -1718,10 +1718,10 @@ static int bond_enslave(struct net_device *master_dev,
*/ */
static int bond_change_active(struct net_device *master_dev, struct net_device *slave_dev) static int bond_change_active(struct net_device *master_dev, struct net_device *slave_dev)
{ {
bonding_t *bond; struct bonding *bond;
slave_t *slave; struct slave *slave;
slave_t *oldactive = NULL; struct slave *oldactive = NULL;
slave_t *newactive = NULL; struct slave *newactive = NULL;
int ret = 0; int ret = 0;
if (master_dev == NULL || slave_dev == NULL) { if (master_dev == NULL || slave_dev == NULL) {
...@@ -1735,12 +1735,12 @@ static int bond_change_active(struct net_device *master_dev, struct net_device * ...@@ -1735,12 +1735,12 @@ static int bond_change_active(struct net_device *master_dev, struct net_device *
return -EINVAL; return -EINVAL;
} }
bond = (struct bonding *) master_dev->priv; bond = (struct bonding *)master_dev->priv;
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
slave = (slave_t *)bond; slave = (struct slave *)bond;
oldactive = bond->current_slave; oldactive = bond->current_slave;
while ((slave = slave->prev) != (slave_t *)bond) { while ((slave = slave->prev) != (struct slave *)bond) {
if(slave_dev == slave->dev) { if(slave_dev == slave->dev) {
newactive = slave; newactive = slave;
break; break;
...@@ -1782,7 +1782,7 @@ static struct slave *find_best_interface(struct bonding *bond) ...@@ -1782,7 +1782,7 @@ static struct slave *find_best_interface(struct bonding *bond)
newslave = oldslave = bond->current_slave; newslave = oldslave = bond->current_slave;
if (newslave == NULL) { /* there were no active slaves left */ if (newslave == NULL) { /* there were no active slaves left */
if (bond->next != (slave_t *)bond) { /* found one slave */ if (bond->next != (struct slave *)bond) { /* found one slave */
newslave = bond->next; newslave = bond->next;
} else { } else {
return NULL; /* still no slave, return NULL */ return NULL; /* still no slave, return NULL */
...@@ -1934,15 +1934,15 @@ static void reselect_active_interface(struct bonding *bond) ...@@ -1934,15 +1934,15 @@ static void reselect_active_interface(struct bonding *bond)
*/ */
static int bond_release(struct net_device *master, struct net_device *slave) static int bond_release(struct net_device *master, struct net_device *slave)
{ {
bonding_t *bond; struct bonding *bond;
slave_t *our_slave, *old_current; struct slave *our_slave, *old_current;
struct sockaddr addr; struct sockaddr addr;
if (master == NULL || slave == NULL) { if (master == NULL || slave == NULL) {
return -ENODEV; return -ENODEV;
} }
bond = (struct bonding *) master->priv; bond = (struct bonding *)master->priv;
/* master already enslaved, or slave not enslaved, /* master already enslaved, or slave not enslaved,
or no slave for this master */ or no slave for this master */
...@@ -1955,9 +1955,9 @@ static int bond_release(struct net_device *master, struct net_device *slave) ...@@ -1955,9 +1955,9 @@ static int bond_release(struct net_device *master, struct net_device *slave)
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
our_slave = (slave_t *)bond; our_slave = (struct slave *)bond;
old_current = bond->current_slave; old_current = bond->current_slave;
while ((our_slave = our_slave->prev) != (slave_t *)bond) { while ((our_slave = our_slave->prev) != (struct slave *)bond) {
if (our_slave->dev == slave) { if (our_slave->dev == slave) {
int mac_addr_differ = memcmp(bond->device->dev_addr, int mac_addr_differ = memcmp(bond->device->dev_addr,
our_slave->perm_hwaddr, our_slave->perm_hwaddr,
...@@ -2029,7 +2029,7 @@ static int bond_release(struct net_device *master, struct net_device *slave) ...@@ -2029,7 +2029,7 @@ static int bond_release(struct net_device *master, struct net_device *slave)
} }
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
if (our_slave == (slave_t *)bond) { if (our_slave == (struct slave *)bond) {
/* if we get here, it's because the device was not found */ /* if we get here, it's because the device was not found */
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: %s not enslaved\n", ": %s: %s not enslaved\n",
...@@ -2084,7 +2084,7 @@ static int bond_release(struct net_device *master, struct net_device *slave) ...@@ -2084,7 +2084,7 @@ static int bond_release(struct net_device *master, struct net_device *slave)
* of the master so it will be set by the application * of the master so it will be set by the application
* to the mac address of the first slave * to the mac address of the first slave
*/ */
if (bond->next == (slave_t*)bond) { if (bond->next == (struct slave *)bond) {
memset(master->dev_addr, 0, master->addr_len); memset(master->dev_addr, 0, master->addr_len);
} }
...@@ -2096,8 +2096,8 @@ static int bond_release(struct net_device *master, struct net_device *slave) ...@@ -2096,8 +2096,8 @@ static int bond_release(struct net_device *master, struct net_device *slave)
*/ */
static int bond_release_all(struct net_device *master) static int bond_release_all(struct net_device *master)
{ {
bonding_t *bond; struct bonding *bond;
slave_t *our_slave, *old_current; struct slave *our_slave, *old_current;
struct net_device *slave_dev; struct net_device *slave_dev;
struct sockaddr addr; struct sockaddr addr;
int err = 0; int err = 0;
...@@ -2110,7 +2110,7 @@ static int bond_release_all(struct net_device *master) ...@@ -2110,7 +2110,7 @@ static int bond_release_all(struct net_device *master)
return -EINVAL; return -EINVAL;
} }
bond = (struct bonding *) master->priv; bond = (struct bonding *)master->priv;
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
if (bond->next == (struct slave *) bond) { if (bond->next == (struct slave *) bond) {
...@@ -2123,7 +2123,7 @@ static int bond_release_all(struct net_device *master) ...@@ -2123,7 +2123,7 @@ static int bond_release_all(struct net_device *master)
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
bond->primary_slave = NULL; bond->primary_slave = NULL;
while ((our_slave = bond->prev) != (slave_t *)bond) { while ((our_slave = bond->prev) != (struct slave *)bond) {
/* Inform AD package of unbinding of slave /* Inform AD package of unbinding of slave
* before slave is detached from the list. * before slave is detached from the list.
*/ */
...@@ -2208,8 +2208,8 @@ static int bond_release_all(struct net_device *master) ...@@ -2208,8 +2208,8 @@ static int bond_release_all(struct net_device *master)
/* this function is called regularly to monitor each slave's link. */ /* this function is called regularly to monitor each slave's link. */
static void bond_mii_monitor(struct net_device *master) static void bond_mii_monitor(struct net_device *master)
{ {
bonding_t *bond = (struct bonding *) master->priv; struct bonding *bond = (struct bonding *)master->priv;
slave_t *slave, *oldcurrent; struct slave *slave, *oldcurrent;
int slave_died = 0; int slave_died = 0;
int do_failover = 0; int do_failover = 0;
...@@ -2221,13 +2221,13 @@ static void bond_mii_monitor(struct net_device *master) ...@@ -2221,13 +2221,13 @@ static void bond_mii_monitor(struct net_device *master)
* program could monitor the link itself if needed. * program could monitor the link itself if needed.
*/ */
slave = (slave_t *)bond; slave = (struct slave *)bond;
read_lock(&bond->ptrlock); read_lock(&bond->ptrlock);
oldcurrent = bond->current_slave; oldcurrent = bond->current_slave;
read_unlock(&bond->ptrlock); read_unlock(&bond->ptrlock);
while ((slave = slave->prev) != (slave_t *)bond) { while ((slave = slave->prev) != (struct slave *)bond) {
struct net_device *dev = slave->dev; struct net_device *dev = slave->dev;
int link_state; int link_state;
u16 old_speed = slave->speed; u16 old_speed = slave->speed;
...@@ -2437,13 +2437,13 @@ static void bond_mii_monitor(struct net_device *master) ...@@ -2437,13 +2437,13 @@ static void bond_mii_monitor(struct net_device *master)
*/ */
static void loadbalance_arp_monitor(struct net_device *master) static void loadbalance_arp_monitor(struct net_device *master)
{ {
bonding_t *bond; struct bonding *bond;
slave_t *slave, *oldcurrent; struct slave *slave, *oldcurrent;
int the_delta_in_ticks = arp_interval * HZ / 1000; int the_delta_in_ticks = arp_interval * HZ / 1000;
int next_timer = jiffies + (arp_interval * HZ / 1000); int next_timer = jiffies + (arp_interval * HZ / 1000);
int do_failover = 0; int do_failover = 0;
bond = (struct bonding *) master->priv; bond = (struct bonding *)master->priv;
if (master->priv == NULL) { if (master->priv == NULL) {
mod_timer(&bond->arp_timer, next_timer); mod_timer(&bond->arp_timer, next_timer);
return; return;
...@@ -2477,8 +2477,8 @@ static void loadbalance_arp_monitor(struct net_device *master) ...@@ -2477,8 +2477,8 @@ static void loadbalance_arp_monitor(struct net_device *master)
* TODO: what about up/down delay in arp mode? it wasn't here before * TODO: what about up/down delay in arp mode? it wasn't here before
* so it can wait * so it can wait
*/ */
slave = (slave_t *)bond; slave = (struct slave *)bond;
while ((slave = slave->prev) != (slave_t *)bond) { while ((slave = slave->prev) != (struct slave *)bond) {
if (slave->link != BOND_LINK_UP) { if (slave->link != BOND_LINK_UP) {
...@@ -2587,12 +2587,12 @@ static void loadbalance_arp_monitor(struct net_device *master) ...@@ -2587,12 +2587,12 @@ static void loadbalance_arp_monitor(struct net_device *master)
*/ */
static void activebackup_arp_monitor(struct net_device *master) static void activebackup_arp_monitor(struct net_device *master)
{ {
bonding_t *bond; struct bonding *bond;
slave_t *slave; struct slave *slave;
int the_delta_in_ticks = arp_interval * HZ / 1000; int the_delta_in_ticks = arp_interval * HZ / 1000;
int next_timer = jiffies + (arp_interval * HZ / 1000); int next_timer = jiffies + (arp_interval * HZ / 1000);
bond = (struct bonding *) master->priv; bond = (struct bonding *)master->priv;
if (master->priv == NULL) { if (master->priv == NULL) {
mod_timer(&bond->arp_timer, next_timer); mod_timer(&bond->arp_timer, next_timer);
return; return;
...@@ -2610,8 +2610,8 @@ static void activebackup_arp_monitor(struct net_device *master) ...@@ -2610,8 +2610,8 @@ static void activebackup_arp_monitor(struct net_device *master)
* TODO: what about up/down delay in arp mode? it wasn't here before * TODO: what about up/down delay in arp mode? it wasn't here before
* so it can wait * so it can wait
*/ */
slave = (slave_t *)bond; slave = (struct slave *)bond;
while ((slave = slave->prev) != (slave_t *)bond) { while ((slave = slave->prev) != (struct slave *)bond) {
if (slave->link != BOND_LINK_UP) { if (slave->link != BOND_LINK_UP) {
if ((jiffies - slave->dev->last_rx) <= if ((jiffies - slave->dev->last_rx) <=
...@@ -2757,11 +2757,11 @@ static void activebackup_arp_monitor(struct net_device *master) ...@@ -2757,11 +2757,11 @@ static void activebackup_arp_monitor(struct net_device *master)
if (slave == NULL) { if (slave == NULL) {
if ((bond->current_arp_slave == NULL) || if ((bond->current_arp_slave == NULL) ||
(bond->current_arp_slave == (slave_t *)bond)) { (bond->current_arp_slave == (struct slave *)bond)) {
bond->current_arp_slave = bond->prev; bond->current_arp_slave = bond->prev;
} }
if (bond->current_arp_slave != (slave_t *)bond) { if (bond->current_arp_slave != (struct slave *)bond) {
bond_set_slave_inactive_flags(bond->current_arp_slave); bond_set_slave_inactive_flags(bond->current_arp_slave);
slave = bond->current_arp_slave->next; slave = bond->current_arp_slave->next;
...@@ -2817,15 +2817,15 @@ static int bond_sethwaddr(struct net_device *master, struct net_device *slave) ...@@ -2817,15 +2817,15 @@ static int bond_sethwaddr(struct net_device *master, struct net_device *slave)
static int bond_info_query(struct net_device *master, struct ifbond *info) static int bond_info_query(struct net_device *master, struct ifbond *info)
{ {
bonding_t *bond = (struct bonding *) master->priv; struct bonding *bond = (struct bonding *)master->priv;
slave_t *slave; struct slave *slave;
info->bond_mode = bond_mode; info->bond_mode = bond_mode;
info->num_slaves = 0; info->num_slaves = 0;
info->miimon = miimon; info->miimon = miimon;
read_lock_bh(&bond->lock); read_lock_bh(&bond->lock);
for (slave = bond->prev; slave != (slave_t *)bond; slave = slave->prev) { for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev) {
info->num_slaves++; info->num_slaves++;
} }
read_unlock_bh(&bond->lock); read_unlock_bh(&bond->lock);
...@@ -2836,8 +2836,8 @@ static int bond_info_query(struct net_device *master, struct ifbond *info) ...@@ -2836,8 +2836,8 @@ static int bond_info_query(struct net_device *master, struct ifbond *info)
static int bond_slave_info_query(struct net_device *master, static int bond_slave_info_query(struct net_device *master,
struct ifslave *info) struct ifslave *info)
{ {
bonding_t *bond = (struct bonding *) master->priv; struct bonding *bond = (struct bonding *)master->priv;
slave_t *slave; struct slave *slave;
int cur_ndx = 0; int cur_ndx = 0;
if (info->slave_id < 0) { if (info->slave_id < 0) {
...@@ -2846,13 +2846,13 @@ static int bond_slave_info_query(struct net_device *master, ...@@ -2846,13 +2846,13 @@ static int bond_slave_info_query(struct net_device *master,
read_lock_bh(&bond->lock); read_lock_bh(&bond->lock);
for (slave = bond->prev; for (slave = bond->prev;
slave != (slave_t *)bond && cur_ndx < info->slave_id; slave != (struct slave *)bond && cur_ndx < info->slave_id;
slave = slave->prev) { slave = slave->prev) {
cur_ndx++; cur_ndx++;
} }
read_unlock_bh(&bond->lock); read_unlock_bh(&bond->lock);
if (slave != (slave_t *)bond) { if (slave != (struct slave *)bond) {
strcpy(info->slave_name, slave->dev->name); strcpy(info->slave_name, slave->dev->name);
info->link = slave->link; info->link = slave->link;
info->state = slave->state; info->state = slave->state;
...@@ -2869,7 +2869,7 @@ static int bond_ethtool_ioctl(struct net_device *master_dev, struct ifreq *ifr) ...@@ -2869,7 +2869,7 @@ static int bond_ethtool_ioctl(struct net_device *master_dev, struct ifreq *ifr)
void *addr = ifr->ifr_data; void *addr = ifr->ifr_data;
uint32_t cmd; uint32_t cmd;
if (get_user(cmd, (uint32_t *) addr)) if (get_user(cmd, (uint32_t *)addr))
return -EFAULT; return -EFAULT;
switch (cmd) { switch (cmd) {
...@@ -3060,8 +3060,8 @@ static int bond_accept_fastpath(struct net_device *dev, struct dst_entry *dst) ...@@ -3060,8 +3060,8 @@ static int bond_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
*/ */
static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *dev) static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *dev)
{ {
slave_t *slave, *start_at; struct slave *slave, *start_at;
struct bonding *bond = (struct bonding *) dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
struct net_device *device_we_should_send_to = 0; struct net_device *device_we_should_send_to = 0;
if (!IS_UP(dev)) { /* bond down */ if (!IS_UP(dev)) { /* bond down */
...@@ -3117,8 +3117,8 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *dev) ...@@ -3117,8 +3117,8 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *dev)
static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *dev) static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *dev)
{ {
slave_t *slave, *start_at; struct slave *slave, *start_at;
struct bonding *bond = (struct bonding *) dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
if (!IS_UP(dev)) { /* bond down */ if (!IS_UP(dev)) { /* bond down */
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -3169,8 +3169,8 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *dev) ...@@ -3169,8 +3169,8 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *dev)
*/ */
static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev) static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev)
{ {
slave_t *slave, *start_at; struct slave *slave, *start_at;
struct bonding *bond = (struct bonding *) dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
struct ethhdr *data = (struct ethhdr *)skb->data; struct ethhdr *data = (struct ethhdr *)skb->data;
int slave_no; int slave_no;
...@@ -3192,7 +3192,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -3192,7 +3192,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev)
slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt; slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt;
while ( (slave_no > 0) && (slave != (slave_t *)bond) ) { while ( (slave_no > 0) && (slave != (struct slave *)bond) ) {
slave = slave->prev; slave = slave->prev;
slave_no--; slave_no--;
} }
...@@ -3224,7 +3224,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -3224,7 +3224,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *dev)
*/ */
static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev) static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev)
{ {
struct bonding *bond = (struct bonding *) dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
int ret; int ret;
if (!IS_UP(dev)) { /* bond down */ if (!IS_UP(dev)) { /* bond down */
...@@ -3289,15 +3289,15 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev) ...@@ -3289,15 +3289,15 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *bond_get_stats(struct net_device *dev) static struct net_device_stats *bond_get_stats(struct net_device *dev)
{ {
bonding_t *bond = dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
struct net_device_stats *stats = &(bond->stats), *sstats; struct net_device_stats *stats = &(bond->stats), *sstats;
slave_t *slave; struct slave *slave;
memset(stats, 0, sizeof(struct net_device_stats)); memset(stats, 0, sizeof(struct net_device_stats));
read_lock_bh(&bond->lock); read_lock_bh(&bond->lock);
for (slave = bond->prev; slave != (slave_t *)bond; slave = slave->prev) { for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev) {
sstats = slave->dev->get_stats(slave->dev); sstats = slave->dev->get_stats(slave->dev);
stats->rx_packets += sstats->rx_packets; stats->rx_packets += sstats->rx_packets;
...@@ -3350,7 +3350,7 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) ...@@ -3350,7 +3350,7 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
return SEQ_START_TOKEN; return SEQ_START_TOKEN;
} }
for (slave = bond->prev; slave != (slave_t *)bond; for (slave = bond->prev; slave != (struct slave *)bond;
slave = slave->prev) { slave = slave->prev) {
if (++off == *pos) { if (++off == *pos) {
...@@ -3612,7 +3612,7 @@ static void bond_destroy_proc_dir(void) ...@@ -3612,7 +3612,7 @@ static void bond_destroy_proc_dir(void)
static inline int static inline int
bond_set_mac_address(struct net_device *dev, void *addr) bond_set_mac_address(struct net_device *dev, void *addr)
{ {
struct bonding *bond = dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
struct sockaddr *sa = addr, tmp_sa; struct sockaddr *sa = addr, tmp_sa;
struct slave *slave; struct slave *slave;
int error; int error;
...@@ -3673,14 +3673,14 @@ bond_set_mac_address(struct net_device *dev, void *addr) ...@@ -3673,14 +3673,14 @@ bond_set_mac_address(struct net_device *dev, void *addr)
static inline int static inline int
bond_change_mtu(struct net_device *dev, int newmtu) bond_change_mtu(struct net_device *dev, int newmtu)
{ {
bonding_t *bond = dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
slave_t *slave; struct slave *slave;
int error; int error;
dprintk("bond=%p, name=%s, new_mtu=%d\n", bond, dprintk("bond=%p, name=%s, new_mtu=%d\n", bond,
(bond_dev ? bond_dev->name : "None"), new_mtu); (bond_dev ? bond_dev->name : "None"), new_mtu);
for (slave = bond->prev; slave != (slave_t *)bond; for (slave = bond->prev; slave != (struct slave *)bond;
slave = slave->prev) { slave = slave->prev) {
dprintk("s %p s->p %p c_m %p\n", slave, dprintk("s %p s->p %p c_m %p\n", slave,
slave->prev, slave->dev->change_mtu); slave->prev, slave->dev->change_mtu);
...@@ -3741,7 +3741,7 @@ static int bond_master_netdev_event(unsigned long event, struct net_device *even ...@@ -3741,7 +3741,7 @@ static int bond_master_netdev_event(unsigned long event, struct net_device *even
struct bonding *bond, *event_bond = NULL; struct bonding *bond, *event_bond = NULL;
list_for_each_entry(bond, &bond_dev_list, bond_list) { list_for_each_entry(bond, &bond_dev_list, bond_list) {
if (bond == event_dev->priv) { if (bond == (struct bonding *)event_dev->priv) {
event_bond = bond; event_bond = bond;
break; break;
} }
...@@ -3855,7 +3855,7 @@ static struct notifier_block bond_netdev_notifier = { ...@@ -3855,7 +3855,7 @@ static struct notifier_block bond_netdev_notifier = {
*/ */
static inline void bond_deinit(struct net_device *dev) static inline void bond_deinit(struct net_device *dev)
{ {
struct bonding *bond = dev->priv; struct bonding *bond = (struct bonding *)dev->priv;
list_del(&bond->bond_list); list_del(&bond->bond_list);
...@@ -3894,14 +3894,14 @@ static int __init bond_init(struct net_device *dev) ...@@ -3894,14 +3894,14 @@ static int __init bond_init(struct net_device *dev)
dprintk("Begin bond_init for %s\n", dev->name); dprintk("Begin bond_init for %s\n", dev->name);
bond = dev->priv; bond = (struct bonding *)dev->priv;
/* initialize rwlocks */ /* initialize rwlocks */
rwlock_init(&bond->lock); rwlock_init(&bond->lock);
rwlock_init(&bond->ptrlock); rwlock_init(&bond->ptrlock);
/* Initialize pointers */ /* Initialize pointers */
bond->next = bond->prev = (slave_t *)bond; bond->next = bond->prev = (struct slave *)bond;
bond->current_slave = NULL; bond->current_slave = NULL;
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
bond->device = dev; bond->device = dev;
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
((slave)->state == BOND_STATE_ACTIVE)) ((slave)->state == BOND_STATE_ACTIVE))
typedef struct slave { struct slave {
struct slave *next; struct slave *next;
struct slave *prev; struct slave *prev;
struct net_device *dev; struct net_device *dev;
...@@ -76,7 +76,7 @@ typedef struct slave { ...@@ -76,7 +76,7 @@ typedef struct slave {
u8 perm_hwaddr[ETH_ALEN]; u8 perm_hwaddr[ETH_ALEN];
struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */ struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */
struct tlb_slave_info tlb_info; struct tlb_slave_info tlb_info;
} slave_t; };
/* /*
* Here are the locking policies for the two bonding locks: * Here are the locking policies for the two bonding locks:
...@@ -87,12 +87,12 @@ typedef struct slave { ...@@ -87,12 +87,12 @@ typedef struct slave {
* 3) When we lock with bond->ptrlock, we must lock with bond->lock * 3) When we lock with bond->ptrlock, we must lock with bond->lock
* beforehand. * beforehand.
*/ */
typedef struct bonding { struct bonding {
slave_t *next; struct slave *next;
slave_t *prev; struct slave *prev;
slave_t *current_slave; struct slave *current_slave;
slave_t *primary_slave; struct slave *primary_slave;
slave_t *current_arp_slave; struct slave *current_arp_slave;
__s32 slave_cnt; __s32 slave_cnt;
rwlock_t lock; rwlock_t lock;
rwlock_t ptrlock; rwlock_t ptrlock;
...@@ -109,22 +109,22 @@ typedef struct bonding { ...@@ -109,22 +109,22 @@ typedef struct bonding {
unsigned short flags; unsigned short flags;
struct ad_bond_info ad_info; struct ad_bond_info ad_info;
struct alb_bond_info alb_info; struct alb_bond_info alb_info;
} bonding_t; };
/* Forward declarations */ /* Forward declarations */
void bond_set_slave_active_flags(slave_t *slave); void bond_set_slave_active_flags(struct slave *slave);
void bond_set_slave_inactive_flags(slave_t *slave); void bond_set_slave_inactive_flags(struct slave *slave);
/** /**
* These functions can be used for iterating the slave list * These functions can be used for iterating the slave list
* (which is circular) * (which is circular)
* Caller must hold bond lock for read * Caller must hold bond lock for read
*/ */
extern inline struct slave* extern inline struct slave *
bond_get_first_slave(struct bonding *bond) bond_get_first_slave(struct bonding *bond)
{ {
/* if there are no slaves return NULL */ /* if there are no slaves return NULL */
if (bond->next == (slave_t *)bond) { if (bond->next == (struct slave *)bond) {
return NULL; return NULL;
} }
return bond->next; return bond->next;
...@@ -133,7 +133,7 @@ bond_get_first_slave(struct bonding *bond) ...@@ -133,7 +133,7 @@ bond_get_first_slave(struct bonding *bond)
/** /**
* Caller must hold bond lock for read * Caller must hold bond lock for read
*/ */
extern inline struct slave* extern inline struct slave *
bond_get_next_slave(struct bonding *bond, struct slave *slave) bond_get_next_slave(struct bonding *bond, struct slave *slave)
{ {
/* If we have reached the last slave return NULL */ /* If we have reached the last slave return NULL */
...@@ -148,13 +148,13 @@ bond_get_next_slave(struct bonding *bond, struct slave *slave) ...@@ -148,13 +148,13 @@ bond_get_next_slave(struct bonding *bond, struct slave *slave)
* *
* Caller must hold bond lock for read * Caller must hold bond lock for read
*/ */
extern inline struct slave* extern inline struct slave *
bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev) bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
{ {
struct slave *our_slave = bond->next; struct slave *our_slave = bond->next;
/* check if the list of slaves is empty */ /* check if the list of slaves is empty */
if (our_slave == (slave_t *)bond) { if (our_slave == (struct slave *)bond) {
return NULL; return NULL;
} }
...@@ -166,14 +166,14 @@ bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev) ...@@ -166,14 +166,14 @@ bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
return our_slave; return our_slave;
} }
extern inline struct bonding* extern inline struct bonding *
bond_get_bond_by_slave(struct slave *slave) bond_get_bond_by_slave(struct slave *slave)
{ {
if (!slave || !slave->dev->master) { if (!slave || !slave->dev->master) {
return NULL; return NULL;
} }
return (struct bonding *)(slave->dev->master->priv); return (struct bonding *)slave->dev->master->priv;
} }
#endif /* _LINUX_BONDING_H */ #endif /* _LINUX_BONDING_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment