~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/tipc/config.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * net/tipc/config.c: TIPC configuration management code
3
3
 *
4
4
 * Copyright (c) 2002-2006, Ericsson AB
5
 
 * Copyright (c) 2004-2007, Wind River Systems
 
5
 * Copyright (c) 2004-2007, 2010-2011, Wind River Systems
6
6
 * All rights reserved.
7
7
 *
8
8
 * Redistribution and use in source and binary forms, with or without
148
148
 
149
149
        args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area);
150
150
        if (tipc_enable_bearer(args->name,
151
 
                               ntohl(args->detect_scope),
 
151
                               ntohl(args->disc_domain),
152
152
                               ntohl(args->priority)))
153
153
                return tipc_cfg_reply_error_string("unable to enable bearer");
154
154
 
260
260
        return tipc_cfg_reply_none();
261
261
}
262
262
 
263
 
static struct sk_buff *cfg_set_max_nodes(void)
264
 
{
265
 
        u32 value;
266
 
 
267
 
        if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
268
 
                return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
269
 
        value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
270
 
        if (value == tipc_max_nodes)
271
 
                return tipc_cfg_reply_none();
272
 
        if (value != delimit(value, 8, 2047))
273
 
                return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
274
 
                                                   " (max nodes must be 8-2047)");
275
 
        if (tipc_mode == TIPC_NET_MODE)
276
 
                return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
277
 
                        " (cannot change max nodes once TIPC has joined a network)");
278
 
        tipc_max_nodes = value;
279
 
        return tipc_cfg_reply_none();
280
 
}
281
 
 
282
263
static struct sk_buff *cfg_set_netid(void)
283
264
{
284
265
        u32 value;
397
378
        case TIPC_CMD_SET_MAX_SUBSCR:
398
379
                rep_tlv_buf = cfg_set_max_subscriptions();
399
380
                break;
400
 
        case TIPC_CMD_SET_MAX_NODES:
401
 
                rep_tlv_buf = cfg_set_max_nodes();
402
 
                break;
403
381
        case TIPC_CMD_SET_NETID:
404
382
                rep_tlv_buf = cfg_set_netid();
405
383
                break;
415
393
        case TIPC_CMD_GET_MAX_SUBSCR:
416
394
                rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions);
417
395
                break;
418
 
        case TIPC_CMD_GET_MAX_NODES:
419
 
                rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes);
420
 
                break;
421
396
        case TIPC_CMD_GET_NETID:
422
397
                rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
423
398
                break;
431
406
        case TIPC_CMD_GET_MAX_SLAVES:
432
407
        case TIPC_CMD_SET_MAX_CLUSTERS:
433
408
        case TIPC_CMD_GET_MAX_CLUSTERS:
 
409
        case TIPC_CMD_SET_MAX_NODES:
 
410
        case TIPC_CMD_GET_MAX_NODES:
434
411
                rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
435
412
                                                          " (obsolete command)");
436
413
                break;