Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219758
b: refs/heads/master
c: 6a0e9fa
h: refs/heads/master
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Sep 5, 2010
1 parent 4731177 commit 45618e7
Show file tree
Hide file tree
Showing 24 changed files with 416 additions and 349 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: bf3264f6d1039e68ec9881447808327c0260ae61
refs/heads/master: 6a0e9fa88df9e3a517a2fd317706aefa10a43191
13 changes: 5 additions & 8 deletions trunk/drivers/staging/batman-adv/aggregation.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,15 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,

#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
/* create a new aggregated packet and add this packet to it */
static void new_aggregated_packet(unsigned char *packet_buff,
int packet_len,
unsigned long send_time,
bool direct_link,
struct batman_if *if_incoming,
int own_packet)
static void new_aggregated_packet(unsigned char *packet_buff, int packet_len,
unsigned long send_time, bool direct_link,
struct batman_if *if_incoming,
int own_packet)
{
struct forw_packet *forw_packet_aggr;
unsigned long flags;
unsigned char *skb_buff;
/* FIXME: each batman_if will be attached to a softif */
struct bat_priv *bat_priv = netdev_priv(soft_device);
struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);

/* own packet should always be scheduled */
if (!own_packet) {
Expand Down
59 changes: 25 additions & 34 deletions trunk/drivers/staging/batman-adv/bat_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ static ssize_t store_frag(struct kobject *kobj, struct attribute *attr,
frag_enabled_tmp == 1 ? "enabled" : "disabled");

atomic_set(&bat_priv->frag_enabled, (unsigned)frag_enabled_tmp);

update_min_mtu();

update_min_mtu(net_dev);
return count;
}

Expand Down Expand Up @@ -358,20 +356,6 @@ int sysfs_add_meshif(struct net_device *dev)
struct bat_attribute **bat_attr;
int err;

/* FIXME: should be done in the general mesh setup
routine as soon as we have it */
atomic_set(&bat_priv->aggregation_enabled, 1);
atomic_set(&bat_priv->bonding_enabled, 0);
atomic_set(&bat_priv->frag_enabled, 1);
atomic_set(&bat_priv->vis_mode, VIS_TYPE_CLIENT_UPDATE);
atomic_set(&bat_priv->orig_interval, 1000);
atomic_set(&bat_priv->log_level, 0);
atomic_set(&bat_priv->bcast_queue_left, BCAST_QUEUE_LEN);
atomic_set(&bat_priv->batman_queue_left, BATMAN_QUEUE_LEN);

bat_priv->primary_if = NULL;
bat_priv->num_ifaces = 0;

bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
batif_kobject);
if (!bat_priv->mesh_obj) {
Expand Down Expand Up @@ -441,32 +425,39 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
if (!batman_if)
return count;

if (strncmp(buff, "none", 4) == 0)
status_tmp = IF_NOT_IN_USE;

if (strncmp(buff, "bat0", 4) == 0)
status_tmp = IF_I_WANT_YOU;

if (status_tmp < 0) {
if (buff[count - 1] == '\n')
buff[count - 1] = '\0';
if (buff[count - 1] == '\n')
buff[count - 1] = '\0';

if (strlen(buff) >= IFNAMSIZ) {
pr_err("Invalid parameter for 'mesh_iface' setting received: "
"%s\n", buff);
"interface name too long '%s'\n", buff);
return -EINVAL;
}

if ((batman_if->if_status == status_tmp) ||
((status_tmp == IF_I_WANT_YOU) &&
(batman_if->if_status != IF_NOT_IN_USE)))
if (strncmp(buff, "none", 4) == 0)
status_tmp = IF_NOT_IN_USE;
else
status_tmp = IF_I_WANT_YOU;

if ((batman_if->if_status == status_tmp) || ((batman_if->soft_iface) &&
(strncmp(batman_if->soft_iface->name, buff, IFNAMSIZ) == 0)))
return count;

if (status_tmp == IF_I_WANT_YOU)
status_tmp = hardif_enable_interface(batman_if);
else
if (status_tmp == IF_NOT_IN_USE) {
rtnl_lock();
hardif_disable_interface(batman_if);
rtnl_unlock();
return count;
}

/* if the interface already is in use */
if (batman_if->if_status != IF_NOT_IN_USE) {
rtnl_lock();
hardif_disable_interface(batman_if);
rtnl_unlock();
}

return (status_tmp < 0 ? status_tmp : count);
return hardif_enable_interface(batman_if, buff);
}

static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/staging/batman-adv/bitarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ static void bit_reset_window(TYPE_OF_WORD *seq_bits)
* 1 if the window was moved (either new or very old)
* 0 if the window was not moved/shifted.
*/
char bit_get_packet(TYPE_OF_WORD *seq_bits, int32_t seq_num_diff,
int8_t set_mark)
char bit_get_packet(void *priv, TYPE_OF_WORD *seq_bits,
int32_t seq_num_diff, int8_t set_mark)
{
/* FIXME: each orig_node->batman_if will be attached to a softif */
struct bat_priv *bat_priv = netdev_priv(soft_device);
struct bat_priv *bat_priv = (struct bat_priv *)priv;

/* sequence number is slightly older. We already got a sequence number
* higher than this one, so we just mark it. */
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/batman-adv/bitarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ void bit_mark(TYPE_OF_WORD *seq_bits, int32_t n);

/* receive and process one packet, returns 1 if received seq_num is considered
* new, 0 if old */
char bit_get_packet(TYPE_OF_WORD *seq_bits, int32_t seq_num_diff,
int8_t set_mark);
char bit_get_packet(void *priv, TYPE_OF_WORD *seq_bits,
int32_t seq_num_diff, int8_t set_mark);

/* count the hamming weight, how many good packets did we receive? */
int bit_packet_count(TYPE_OF_WORD *seq_bits);
Expand Down
Loading

0 comments on commit 45618e7

Please sign in to comment.