solos: various upstreamed solos patches
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-2.6.37 / 283-solos-vccs_release.patch
1 commit c031235b395433350f25943b7580a5e343c7b7b2
2 Author: Philip A. Prindeville <philipp@redfish-solutions.com>
3 Date: Wed Mar 30 13:17:04 2011 +0000
4
5 atm/solos-pci: Don't flap VCs when carrier state changes
6
7 Don't flap VCs when carrier state changes; higher-level protocols
8 can detect loss of connectivity and act accordingly. This is more
9 consistent with how other network interfaces work.
10
11 We no longer use release_vccs() so we can delete it.
12
13 release_vccs() was duplicated from net/atm/common.c; make the
14 corresponding function exported, since other code duplicates it
15 and could leverage it if it were public.
16
17 Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 ---
20 drivers/atm/solos-pci.c | 26 +-------------------------
21 include/linux/atmdev.h | 1 +
22 net/atm/common.c | 1 +
23 3 files changed, 3 insertions(+), 25 deletions(-)
24
25 diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
26 index 968f022..cd0ff66 100644
27 --- a/drivers/atm/solos-pci.c
28 +++ b/drivers/atm/solos-pci.c
29 @@ -165,7 +165,6 @@ static uint32_t fpga_tx(struct solos_card *);
30 static irqreturn_t solos_irq(int irq, void *dev_id);
31 static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
32 static int list_vccs(int vci);
33 -static void release_vccs(struct atm_dev *dev);
34 static int atm_init(struct solos_card *, struct device *);
35 static void atm_remove(struct solos_card *);
36 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
37 @@ -384,7 +383,6 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
38 /* Anything but 'Showtime' is down */
39 if (strcmp(state_str, "Showtime")) {
40 atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST);
41 - release_vccs(card->atmdev[port]);
42 dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
43 return 0;
44 }
45 @@ -830,28 +828,6 @@ static int list_vccs(int vci)
46 return num_found;
47 }
48
49 -static void release_vccs(struct atm_dev *dev)
50 -{
51 - int i;
52 -
53 - write_lock_irq(&vcc_sklist_lock);
54 - for (i = 0; i < VCC_HTABLE_SIZE; i++) {
55 - struct hlist_head *head = &vcc_hash[i];
56 - struct hlist_node *node, *tmp;
57 - struct sock *s;
58 - struct atm_vcc *vcc;
59 -
60 - sk_for_each_safe(s, node, tmp, head) {
61 - vcc = atm_sk(s);
62 - if (vcc->dev == dev) {
63 - vcc_release_async(vcc, -EPIPE);
64 - sk_del_node_init(s);
65 - }
66 - }
67 - }
68 - write_unlock_irq(&vcc_sklist_lock);
69 -}
70 -
71
72 static int popen(struct atm_vcc *vcc)
73 {
74 @@ -1269,7 +1245,7 @@ static int atm_init(struct solos_card *card, struct device *parent)
75 card->atmdev[i]->ci_range.vci_bits = 16;
76 card->atmdev[i]->dev_data = card;
77 card->atmdev[i]->phy_data = (void *)(unsigned long)i;
78 - atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_UNKNOWN);
79 + atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND);
80
81 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
82 if (!skb) {
83 diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
84 index 475f8c4..381f4ce 100644
85 --- a/include/linux/atmdev.h
86 +++ b/include/linux/atmdev.h
87 @@ -443,6 +443,7 @@ void atm_dev_signal_change(struct atm_dev *dev, char signal);
88
89 void vcc_insert_socket(struct sock *sk);
90
91 +void atm_dev_release_vccs(struct atm_dev *dev);
92
93 /*
94 * This is approximately the algorithm used by alloc_skb.
95 diff --git a/net/atm/common.c b/net/atm/common.c
96 index 1b9c52a..22b963d 100644
97 --- a/net/atm/common.c
98 +++ b/net/atm/common.c
99 @@ -252,6 +252,7 @@ void atm_dev_release_vccs(struct atm_dev *dev)
100 }
101 write_unlock_irq(&vcc_sklist_lock);
102 }
103 +EXPORT_SYMBOL(atm_dev_release_vccs);
104
105 static int adjust_tp(struct atm_trafprm *tp, unsigned char aal)
106 {
107