Changeset 15302


Ignore:
Timestamp:
2009-04-20T20:57:36+02:00 (9 years ago)
Author:
nbd
Message:

swconfig: treat struct switch_attr as constant

Location:
trunk/target/linux/generic-2.6/files
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c

    r15301 r15302  
    6060 
    6161static int 
    62 swconfig_get_vlan_ports(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val) 
     62swconfig_get_vlan_ports(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) 
    6363{ 
    6464        int ret; 
     
    7474 
    7575static int 
    76 swconfig_set_vlan_ports(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val) 
     76swconfig_set_vlan_ports(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) 
    7777{ 
    7878        int i; 
     
    9797 
    9898static int 
    99 swconfig_apply_config(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val) 
     99swconfig_apply_config(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) 
    100100{ 
    101101        /* don't complain if not supported by the switch driver */ 
     
    351351                        continue; 
    352352                cb.args[0] = i; 
    353                 err = swconfig_send_multipart(&cb, &alist->attr[i]); 
     353                err = swconfig_send_multipart(&cb, (void *) &alist->attr[i]); 
    354354                if (err < 0) 
    355355                        goto error; 
     
    361361                        continue; 
    362362                cb.args[0] = SWITCH_ATTR_DEFAULTS_OFFSET + i; 
    363                 err = swconfig_send_multipart(&cb, &def_list[i]); 
     363                err = swconfig_send_multipart(&cb, (void *) &def_list[i]); 
    364364                if (err < 0) 
    365365                        goto error; 
     
    380380} 
    381381 
    382 static struct switch_attr * 
     382static const struct switch_attr * 
    383383swconfig_lookup_attr(struct switch_dev *dev, struct genl_info *info, 
    384384                struct switch_val *val) 
     
    386386        struct genlmsghdr *hdr = nlmsg_data(info->nlhdr); 
    387387        const struct switch_attrlist *alist; 
    388         struct switch_attr *attr = NULL; 
     388        const struct switch_attr *attr = NULL; 
    389389        int attr_id; 
    390390 
     
    491491swconfig_set_attr(struct sk_buff *skb, struct genl_info *info) 
    492492{ 
    493         struct switch_attr *attr; 
     493        const struct switch_attr *attr; 
    494494        struct switch_dev *dev; 
    495495        struct switch_val val; 
     
    621621{ 
    622622        struct genlmsghdr *hdr = nlmsg_data(info->nlhdr); 
    623         struct switch_attr *attr; 
     623        const struct switch_attr *attr; 
    624624        struct switch_dev *dev; 
    625625        struct sk_buff *msg = NULL; 
  • trunk/target/linux/generic-2.6/files/include/linux/switch.h

    r13649 r15302  
    105105        /* filled in by the driver */ 
    106106        int n_attr; 
    107         struct switch_attr *attr; 
     107        const struct switch_attr *attr; 
    108108}; 
    109109 
     
    139139 
    140140struct switch_val { 
    141         struct switch_attr *attr; 
     141        const struct switch_attr *attr; 
    142142        int port_vlan; 
    143143        int len; 
     
    155155        const char *description; 
    156156 
    157         int (*set)(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val); 
    158         int (*get)(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val); 
     157        int (*set)(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val); 
     158        int (*get)(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val); 
    159159 
    160160        /* for driver internal use */ 
Note: See TracChangeset for help on using the changeset viewer.