source: trunk/target/linux/brcm47xx/patches-3.2/0041-bcma-add-bus-num-counter.patch @ 29843

Last change on this file since 29843 was 29843, checked in by hauke, 4 years ago

brcm47xx: add support for pcie host controller on bcma based SoCs.

This also adds minimal support for the BCMA43224 pcie wireless card.

File size: 1.8 KB
  • drivers/bcma/main.c

    From eecd733c14952b074d7488934a4f3dc83c9c426b Mon Sep 17 00:00:00 2001
    From: Hauke Mehrtens <hauke@hauke-m.de>
    Date: Sat, 14 Jan 2012 16:29:51 +0100
    Subject: [PATCH 28/32] bcma: add bus num counter
    
    If we have two bcma buses on one computer the second will not work
    without this patch. Now each bus gets an own number.
    
    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
    ---
     drivers/bcma/main.c       |   12 +++++++++++-
     include/linux/bcma/bcma.h |    1 +
     2 files changed, 12 insertions(+), 1 deletions(-)
    
    a b  
    1313MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); 
    1414MODULE_LICENSE("GPL"); 
    1515 
     16/* contains the number the next bus should get. */ 
     17static unsigned int bcma_bus_next_num = 0; 
     18 
     19/* bcma_buses_mutex locks the bcma_bus_next_num */ 
     20static DEFINE_MUTEX(bcma_buses_mutex); 
     21 
    1622static int bcma_bus_match(struct device *dev, struct device_driver *drv); 
    1723static int bcma_device_probe(struct device *dev); 
    1824static int bcma_device_remove(struct device *dev); 
    static int bcma_register_cores(struct bc 
    9399 
    94100                core->dev.release = bcma_release_core_dev; 
    95101                core->dev.bus = &bcma_bus_type; 
    96                 dev_set_name(&core->dev, "bcma%d:%d", 0/*bus->num*/, dev_id); 
     102                dev_set_name(&core->dev, "bcma%d:%d", bus->num, dev_id); 
    97103 
    98104                switch (bus->hosttype) { 
    99105                case BCMA_HOSTTYPE_PCI: 
    int __devinit bcma_bus_register(struct b 
    137143        int err; 
    138144        struct bcma_device *core; 
    139145 
     146        mutex_lock(&bcma_buses_mutex); 
     147        bus->num = bcma_bus_next_num++; 
     148        mutex_unlock(&bcma_buses_mutex); 
     149 
    140150        /* Scan for devices (cores) */ 
    141151        err = bcma_bus_scan(bus); 
    142152        if (err) { 
  • include/linux/bcma/bcma.h

    a b struct bcma_bus { 
    197197        struct list_head cores; 
    198198        u8 nr_cores; 
    199199        u8 init_done:1; 
     200        u8 num; 
    200201 
    201202        struct bcma_drv_cc drv_cc; 
    202203        struct bcma_drv_pci drv_pci; 
Note: See TracBrowser for help on using the repository browser.