• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/net/bonding/

Lines Matching defs:bond

166  * __get_first_port - get the first port in the bond
167 * @bond: the bond we're looking at
169 * Return the port of the first slave in @bond, or %NULL if it can't be found.
171 static inline struct port *__get_first_port(struct bonding *bond)
173 if (bond->slave_cnt == 0) {
177 return &(SLAVE_AD_INFO(bond->first_slave).port);
181 * __get_next_port - get the next port in the bond
185 * bond, or %NULL if it can't be found.
189 struct bonding *bond = __get_bond_by_port(port);
192 // If there's no bond for this port, or this is the last slave
193 if ((bond == NULL) || (slave->next == bond->first_slave)) {
201 * __get_first_agg - get the first aggregator in the bond
202 * @bond: the bond we're looking at
204 * Return the aggregator of the first slave in @bond, or %NULL if it can't be
209 struct bonding *bond = __get_bond_by_port(port);
211 // If there's no bond for this port, or bond has no slaves
212 if ((bond == NULL) || (bond->slave_cnt == 0)) {
216 return &(SLAVE_AD_INFO(bond->first_slave).aggregator);
220 * __get_next_agg - get the next aggregator in the bond
224 * slave in the bond, or %NULL if it can't be found.
229 struct bonding *bond = bond_get_bond_by_slave(slave);
231 // If there's no bond for this aggregator, or this is the last slave
232 if ((bond == NULL) || (slave->next == bond->first_slave)) {
281 struct bonding *bond = __get_bond_by_port(port);
283 if (bond == NULL) {
287 return BOND_AD_INFO(bond).agg_select_mode;
297 struct bonding *bond = __get_bond_by_port(port);
299 if (bond == NULL) {
303 return BOND_AD_INFO(bond).agg_select_timer ? 1 : 0;
1552 "the link partner for any adapters in the bond\n",
1559 "found in the bond. Only one group will function in the bond\n");
1807 * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures
1808 * @bond: bonding struct to work on
1812 * Can be called only after the mac address of the bond is set.
1814 void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast)
1816 // check that the bond is not initialized yet
1817 if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr), &(bond->dev->dev_addr))) {
1821 BOND_AD_INFO(bond).lacp_fast = lacp_fast;
1822 BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
1823 BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
1829 BOND_AD_INFO(bond).agg_select_timer = (AD_AGGREGATOR_SELECTION_TIMER * ad_ticks_per_sec);
1830 BOND_AD_INFO(bond).agg_select_mode = AD_BANDWIDTH;
1843 struct bonding *bond = bond_get_bond_by_slave(slave);
1847 if (bond == NULL) {
1848 printk(KERN_ERR DRV_NAME ": %s: The slave %s is not attached to its bond\n",
1859 ad_initialize_port(port, BOND_AD_INFO(bond).lacp_fast);
1876 // actor system is the bond's system
1877 port->actor_system = BOND_AD_INFO(bond).system.sys_mac_addr;
1892 aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
2039 * @bond: bonding struct to work on
2048 * related to any aggregator, and selects the active aggregator for a bond.
2050 void bond_3ad_state_machine_handler(struct bonding *bond)
2055 read_lock(&bond->lock);
2057 if (bond->kill_timers) {
2062 if (bond->slave_cnt == 0) {
2067 if (BOND_AD_INFO(bond).agg_select_timer && !(--BOND_AD_INFO(bond).agg_select_timer)) {
2068 // select the active aggregator for the bond
2069 if ((port = __get_first_port(bond))) {
2071 printk(KERN_WARNING DRV_NAME ": %s: Warning: bond's first port is "
2072 "uninitialized\n", bond->dev->name);
2082 for (port = __get_first_port(bond); port; port = __get_next_port(port)) {
2085 "port\n", bond->dev->name);
2102 mod_timer(&(BOND_AD_INFO(bond).ad_timer), jiffies + ad_delta_in_ticks);
2104 read_unlock(&bond->lock);
2265 int bond_3ad_set_carrier(struct bonding *bond)
2267 if (__get_active_agg(&(SLAVE_AD_INFO(bond->first_slave).aggregator))) {
2268 if (!netif_carrier_ok(bond->dev)) {
2269 netif_carrier_on(bond->dev);
2275 if (netif_carrier_ok(bond->dev)) {
2276 netif_carrier_off(bond->dev);
2284 * @bond: bonding struct to work on
2285 * @ad_info: ad_info struct to fill with the bond's info
2290 int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
2295 for (port = __get_first_port(bond); port; port = __get_next_port(port)) {
2317 struct bonding *bond = dev->priv;
2328 read_lock(&bond->lock);
2330 if (!BOND_IS_OK(bond)) {
2334 if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
2351 slave_agg_no = bond->xmit_hash_policy(skb, dev, slaves_in_agg);
2353 bond_for_each_slave(bond, slave, i) {
2372 bond_for_each_slave_from(bond, slave, i, start_at) {
2381 res = bond_dev_queue_xmit(bond, skb, slave->dev);
2391 read_unlock(&bond->lock);
2397 struct bonding *bond = dev->priv;
2404 read_lock(&bond->lock);
2414 read_unlock(&bond->lock);