netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] solos-pci: Use shared code for VCC management
@ 2011-03-20 22:30 Philip Prindeville
  2011-03-28  1:06 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Philip Prindeville @ 2011-03-20 22:30 UTC (permalink / raw)
  To: Netdev; +Cc: linux-atm-general

The solos-pci driver duplicates the net/atm/common.c function atm_dev_release_vccs() locally as the static function release_vccs().  Let's have the driver share code.

Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>

---

--- a/drivers/atm/solos-pci.c	2011-03-20 01:42:22.000000000 -0600
+++ b/drivers/atm/solos-pci.c	2011-03-20 14:23:26.000000000 -0600
@@ -165,7 +165,6 @@ static uint32_t fpga_tx(struct solos_car
  static irqreturn_t solos_irq(int irq, void *dev_id);
  static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
  static int list_vccs(int vci);
-static void release_vccs(struct atm_dev *dev);
  static int atm_init(struct solos_card *, struct device *);
  static void atm_remove(struct solos_card *);
  static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
@@ -384,7 +383,7 @@ static int process_status(struct solos_c
  	/* Anything but 'Showtime' is down */
  	if (strcmp(state_str, "Showtime")) {
  		atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST);
-		release_vccs(card->atmdev[port]);
+		atm_dev_release_vccs(card->atmdev[port]);
  		dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
  		return 0;
  	}
@@ -837,28 +836,6 @@ static int list_vccs(int vci)
  	return num_found;
  }

-static void release_vccs(struct atm_dev *dev)
-{
-        int i;
-
-        write_lock_irq(&vcc_sklist_lock);
-        for (i = 0; i<  VCC_HTABLE_SIZE; i++) {
-                struct hlist_head *head =&vcc_hash[i];
-                struct hlist_node *node, *tmp;
-                struct sock *s;
-                struct atm_vcc *vcc;
-
-                sk_for_each_safe(s, node, tmp, head) {
-                        vcc = atm_sk(s);
-                        if (vcc->dev == dev) {
-                                vcc_release_async(vcc, -EPIPE);
-                                sk_del_node_init(s);
-                        }
-                }
-        }
-        write_unlock_irq(&vcc_sklist_lock);
-}
-

  static int popen(struct atm_vcc *vcc)
  {
--- a/net/atm/common.c	2011-01-04 17:50:19.000000000 -0700
+++ b/net/atm/common.c	2011-03-20 15:22:59.000000000 -0600
@@ -252,6 +252,7 @@ void atm_dev_release_vccs(struct atm_dev
  	}
  	write_unlock_irq(&vcc_sklist_lock);
  }
+EXPORT_SYMBOL(atm_dev_release_vccs);

  static int adjust_tp(struct atm_trafprm *tp, unsigned char aal)
  {
--- a/include/linux/atmdev.h	2011-01-04 17:50:19.000000000 -0700
+++ b/include/linux/atmdev.h	2011-03-20 15:25:08.000000000 -0600
@@ -443,6 +443,7 @@ void atm_dev_signal_change(struct atm_de

  void vcc_insert_socket(struct sock *sk);

+void atm_dev_release_vccs(struct atm_dev *dev);

  /*
   * This is approximately the algorithm used by alloc_skb.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] solos-pci: Use shared code for VCC management
  2011-03-20 22:30 [PATCH 1/1] solos-pci: Use shared code for VCC management Philip Prindeville
@ 2011-03-28  1:06 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-03-28  1:06 UTC (permalink / raw)
  To: philipp_subx; +Cc: netdev, linux-atm-general


None of your patches apply cleanly to the current net-2.6
tree.

Please respin all of your patches against net-2.6 so that I
can apply them properly.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-28  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-20 22:30 [PATCH 1/1] solos-pci: Use shared code for VCC management Philip Prindeville
2011-03-28  1:06 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).