source: trunk/target/linux/generic/patches-2.6.37/283-solos-vccs_release.patch @ 26616

Last change on this file since 26616 was 26616, checked in by nbd, 5 years ago

solos: various upstreamed solos patches

These patches were submitted to netdev and will likely be out in 2.6.38.3.
In the meantime, they're needed in 2.6.37.6.
Patch by Philip Prindeville

File size: 3.9 KB
  • drivers/atm/solos-pci.c

    commit c031235b395433350f25943b7580a5e343c7b7b2
    Author: Philip A. Prindeville <philipp@redfish-solutions.com>
    Date:   Wed Mar 30 13:17:04 2011 +0000
    
        atm/solos-pci: Don't flap VCs when carrier state changes
        
        Don't flap VCs when carrier state changes; higher-level protocols
        can detect loss of connectivity and act accordingly. This is more
        consistent with how other network interfaces work.
        
        We no longer use release_vccs() so we can delete it.
        
        release_vccs() was duplicated from net/atm/common.c; make the
        corresponding function exported, since other code duplicates it
        and could leverage it if it were public.
        
        Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
        Signed-off-by: David S. Miller <davem@davemloft.net>
    ---
     drivers/atm/solos-pci.c |   26 +-------------------------
     include/linux/atmdev.h  |    1 +
     net/atm/common.c        |    1 +
     3 files changed, 3 insertions(+), 25 deletions(-)
    
    diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
    index 968f022..cd0ff66 100644
    a b static uint32_t fpga_tx(struct solos_card *); 
    165165static irqreturn_t solos_irq(int irq, void *dev_id); 
    166166static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); 
    167167static int list_vccs(int vci); 
    168 static void release_vccs(struct atm_dev *dev); 
    169168static int atm_init(struct solos_card *, struct device *); 
    170169static void atm_remove(struct solos_card *); 
    171170static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); 
    static int process_status(struct solos_card *card, int port, struct sk_buff *skb 
    384383        /* Anything but 'Showtime' is down */ 
    385384        if (strcmp(state_str, "Showtime")) { 
    386385                atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST); 
    387                 release_vccs(card->atmdev[port]); 
    388386                dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str); 
    389387                return 0; 
    390388        } 
    static int list_vccs(int vci) 
    830828        return num_found; 
    831829} 
    832830 
    833 static void release_vccs(struct atm_dev *dev) 
    834 { 
    835         int i; 
    836  
    837         write_lock_irq(&vcc_sklist_lock); 
    838         for (i = 0; i < VCC_HTABLE_SIZE; i++) { 
    839                 struct hlist_head *head = &vcc_hash[i]; 
    840                 struct hlist_node *node, *tmp; 
    841                 struct sock *s; 
    842                 struct atm_vcc *vcc; 
    843  
    844                 sk_for_each_safe(s, node, tmp, head) { 
    845                         vcc = atm_sk(s); 
    846                         if (vcc->dev == dev) { 
    847                                 vcc_release_async(vcc, -EPIPE); 
    848                                 sk_del_node_init(s); 
    849                         } 
    850                 } 
    851         } 
    852         write_unlock_irq(&vcc_sklist_lock); 
    853 } 
    854  
    855831 
    856832static int popen(struct atm_vcc *vcc) 
    857833{ 
    static int atm_init(struct solos_card *card, struct device *parent) 
    12691245                card->atmdev[i]->ci_range.vci_bits = 16; 
    12701246                card->atmdev[i]->dev_data = card; 
    12711247                card->atmdev[i]->phy_data = (void *)(unsigned long)i; 
    1272                 atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_UNKNOWN); 
     1248                atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND); 
    12731249 
    12741250                skb = alloc_skb(sizeof(*header), GFP_ATOMIC); 
    12751251                if (!skb) { 
  • include/linux/atmdev.h

    diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
    index 475f8c4..381f4ce 100644
    a b void atm_dev_signal_change(struct atm_dev *dev, char signal); 
    443443 
    444444void vcc_insert_socket(struct sock *sk); 
    445445 
     446void atm_dev_release_vccs(struct atm_dev *dev); 
    446447 
    447448/* 
    448449 * This is approximately the algorithm used by alloc_skb. 
  • net/atm/common.c

    diff --git a/net/atm/common.c b/net/atm/common.c
    index 1b9c52a..22b963d 100644
    a b void atm_dev_release_vccs(struct atm_dev *dev) 
    252252        } 
    253253        write_unlock_irq(&vcc_sklist_lock); 
    254254} 
     255EXPORT_SYMBOL(atm_dev_release_vccs); 
    255256 
    256257static int adjust_tp(struct atm_trafprm *tp, unsigned char aal) 
    257258{ 
Note: See TracBrowser for help on using the repository browser.