Changeset d40cbce in freewrt for target/linux


Ignore:
Timestamp:
Jul 17, 2006, 5:06:35 AM (19 years ago)
Author:
Waldemar Brodkorb <wbx@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
83201d3
Parents:
30d630b
Message:

use whiterussian switch drivers

git-svn-id: svn://www.freewrt.org/trunk/freewrt@269 afb5a338-a214-0410-bd46-81f09a774fd1

Location:
target/linux/package/switch/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • target/linux/package/switch/src/switch-core.c

    r30d630b rd40cbce  
    6868        write: switch_proc_write
    6969};
     70
     71static inline char *strdup(char *str)
     72{
     73        char *new = kmalloc(strlen(str) + 1, GFP_KERNEL);
     74        strcpy(new, str);
     75        return new;
     76}
    7077
    7178static ssize_t switch_proc_read(struct file *file, char *buf, size_t count, loff_t *ppos)
  • target/linux/package/switch/src/switch-core.h

    r30d630b rd40cbce  
    4949extern int switch_print_media(char *buf, int media);
    5050
    51 static inline char *strdup(char *str)
    52 {
    53         char *new = kmalloc(strlen(str) + 1, GFP_KERNEL);
    54         strcpy(new, str);
    55         return new;
    56 }
    57 
    58 
    5951#endif
  • target/linux/package/switch/src/switch-robo.c

    r30d630b rd40cbce  
    5252#define SIOCSETCPHYWR           (SIOCDEVPRIVATE + 10)
    5353
    54 static char *device;
    5554static int use_et = 0;
    5655static int is_5350 = 0;
     
    315314                }
    316315        }
    317 
     316       
    318317        buf[len] = '\0';
    319318
     
    429428static int __init robo_init()
    430429{
     430        char *device = "ethX";
    431431        int notfound = 1;
    432432
    433         device = strdup("ethX");
    434433        for (device[3] = '0'; (device[3] <= '3') && notfound; device[3]++) {
    435434                notfound = robo_probe(device);
     
    437436        device[3]--;
    438437       
    439         if (notfound) {
    440                 kfree(device);
     438        if (notfound)
    441439                return -ENODEV;
    442         } else {
     440        else {
    443441                switch_config cfg[] = {
    444442                        {"enable", handle_enable_read, handle_enable_write},
     
    470468{
    471469        switch_unregister_driver(DRIVER_NAME);
    472         kfree(device);
    473470}
    474471
Note: See TracChangeset for help on using the changeset viewer.