aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/solos-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atm/solos-pci.c')
-rw-r--r--drivers/atm/solos-pci.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 25ef1a4556e6..cd0ff66469b2 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -165,7 +165,6 @@ static uint32_t fpga_tx(struct solos_card *);
165static irqreturn_t solos_irq(int irq, void *dev_id); 165static irqreturn_t solos_irq(int irq, void *dev_id);
166static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); 166static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
167static int list_vccs(int vci); 167static int list_vccs(int vci);
168static void release_vccs(struct atm_dev *dev);
169static int atm_init(struct solos_card *, struct device *); 168static int atm_init(struct solos_card *, struct device *);
170static void atm_remove(struct solos_card *); 169static void atm_remove(struct solos_card *);
171static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); 170static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
@@ -384,7 +383,6 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
384 /* Anything but 'Showtime' is down */ 383 /* Anything but 'Showtime' is down */
385 if (strcmp(state_str, "Showtime")) { 384 if (strcmp(state_str, "Showtime")) {
386 atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST); 385 atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST);
387 release_vccs(card->atmdev[port]);
388 dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str); 386 dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
389 return 0; 387 return 0;
390 } 388 }
@@ -697,7 +695,7 @@ void solos_bh(unsigned long card_arg)
697 size); 695 size);
698 } 696 }
699 if (atmdebug) { 697 if (atmdebug) {
700 dev_info(&card->dev->dev, "Received: device %d\n", port); 698 dev_info(&card->dev->dev, "Received: port %d\n", port);
701 dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n", 699 dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
702 size, le16_to_cpu(header->vpi), 700 size, le16_to_cpu(header->vpi),
703 le16_to_cpu(header->vci)); 701 le16_to_cpu(header->vci));
@@ -710,8 +708,8 @@ void solos_bh(unsigned long card_arg)
710 le16_to_cpu(header->vci)); 708 le16_to_cpu(header->vci));
711 if (!vcc) { 709 if (!vcc) {
712 if (net_ratelimit()) 710 if (net_ratelimit())
713 dev_warn(&card->dev->dev, "Received packet for unknown VCI.VPI %d.%d on port %d\n", 711 dev_warn(&card->dev->dev, "Received packet for unknown VPI.VCI %d.%d on port %d\n",
714 le16_to_cpu(header->vci), le16_to_cpu(header->vpi), 712 le16_to_cpu(header->vpi), le16_to_cpu(header->vci),
715 port); 713 port);
716 continue; 714 continue;
717 } 715 }
@@ -830,28 +828,6 @@ static int list_vccs(int vci)
830 return num_found; 828 return num_found;
831} 829}
832 830
833static 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
855 831
856static int popen(struct atm_vcc *vcc) 832static int popen(struct atm_vcc *vcc)
857{ 833{
@@ -1018,8 +994,15 @@ static uint32_t fpga_tx(struct solos_card *card)
1018 994
1019 /* Clean up and free oldskb now it's gone */ 995 /* Clean up and free oldskb now it's gone */
1020 if (atmdebug) { 996 if (atmdebug) {
997 struct pkt_hdr *header = (void *)oldskb->data;
998 int size = le16_to_cpu(header->size);
999
1000 skb_pull(oldskb, sizeof(*header));
1021 dev_info(&card->dev->dev, "Transmitted: port %d\n", 1001 dev_info(&card->dev->dev, "Transmitted: port %d\n",
1022 port); 1002 port);
1003 dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
1004 size, le16_to_cpu(header->vpi),
1005 le16_to_cpu(header->vci));
1023 print_buffer(oldskb); 1006 print_buffer(oldskb);
1024 } 1007 }
1025 1008
@@ -1262,7 +1245,7 @@ static int atm_init(struct solos_card *card, struct device *parent)
1262 card->atmdev[i]->ci_range.vci_bits = 16; 1245 card->atmdev[i]->ci_range.vci_bits = 16;
1263 card->atmdev[i]->dev_data = card; 1246 card->atmdev[i]->dev_data = card;
1264 card->atmdev[i]->phy_data = (void *)(unsigned long)i; 1247 card->atmdev[i]->phy_data = (void *)(unsigned long)i;
1265 atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_UNKNOWN); 1248 atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND);
1266 1249
1267 skb = alloc_skb(sizeof(*header), GFP_ATOMIC); 1250 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
1268 if (!skb) { 1251 if (!skb) {