All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm
@ 2014-08-30 20:35 ` wfp5p
  0 siblings, 0 replies; 7+ messages in thread
From: wfp5p @ 2014-08-30 20:35 UTC (permalink / raw)
  To: gregkh; +Cc: cascardo, linux-serial, linux-kernel, lidza.louina, devel

From: Bill Pemberton <wfp5p@worldbroken.com>

The jsm driver (drivers/tty/serial/jsm) already supports the Digi Neo
cards that dgnc (staging) supports.  In fact, it appears that jsm was
based on dgnc.  The dgnc driver has PCI ids for more cards than jsm,
this patch moves support for all the Neo cards to jsm.

The result of this will be that dgnc will only support the Classic
cards since the jsm driver doesn't support those cards yet.


Bill Pemberton (2):
  jsm: add support for additional Neo cards
  staging: dgnc: remove Neo card ids from device table

 drivers/staging/dgnc/dgnc_driver.c  | 13 -------------
 drivers/tty/serial/jsm/jsm.h        | 10 ++++++++++
 drivers/tty/serial/jsm/jsm_driver.c | 38 +++++++++++++++++++++++++++++++++----
 3 files changed, 44 insertions(+), 17 deletions(-)

-- 
1.9.3


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

* [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm
@ 2014-08-30 20:35 ` wfp5p
  0 siblings, 0 replies; 7+ messages in thread
From: wfp5p @ 2014-08-30 20:35 UTC (permalink / raw)
  To: gregkh; +Cc: devel, lidza.louina, cascardo, linux-serial, linux-kernel

From: Bill Pemberton <wfp5p@worldbroken.com>

The jsm driver (drivers/tty/serial/jsm) already supports the Digi Neo
cards that dgnc (staging) supports.  In fact, it appears that jsm was
based on dgnc.  The dgnc driver has PCI ids for more cards than jsm,
this patch moves support for all the Neo cards to jsm.

The result of this will be that dgnc will only support the Classic
cards since the jsm driver doesn't support those cards yet.


Bill Pemberton (2):
  jsm: add support for additional Neo cards
  staging: dgnc: remove Neo card ids from device table

 drivers/staging/dgnc/dgnc_driver.c  | 13 -------------
 drivers/tty/serial/jsm/jsm.h        | 10 ++++++++++
 drivers/tty/serial/jsm/jsm_driver.c | 38 +++++++++++++++++++++++++++++++++----
 3 files changed, 44 insertions(+), 17 deletions(-)

-- 
1.9.3

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

* [Patch v2 1/2] jsm: add support for additional Neo cards
  2014-08-30 20:35 ` wfp5p
  (?)
@ 2014-08-30 20:35 ` wfp5p
  -1 siblings, 0 replies; 7+ messages in thread
From: wfp5p @ 2014-08-30 20:35 UTC (permalink / raw)
  To: gregkh; +Cc: cascardo, linux-serial, linux-kernel, lidza.louina, devel

From: Bill Pemberton <wfp5p@worldbroken.com>

Add device ids for additional Neo cards.  The ids come from the dgnc
driver.

Signed-off-by: Bill Pemberton <wfp5p@worldbroken.com>
---
 drivers/tty/serial/jsm/jsm.h        | 10 ++++++++++
 drivers/tty/serial/jsm/jsm_driver.c | 38 +++++++++++++++++++++++++++++++++----
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h
index 844d5e4eb1aa..af7013488aeb 100644
--- a/drivers/tty/serial/jsm/jsm.h
+++ b/drivers/tty/serial/jsm/jsm.h
@@ -67,6 +67,16 @@ do {								\
 #define MAXPORTS	8
 #define MAX_STOPS_SENT	5
 
+/* Board ids */
+#define PCI_DEVICE_ID_NEO_4             0x00B0
+#define PCI_DEVICE_ID_NEO_1_422         0x00CC
+#define PCI_DEVICE_ID_NEO_1_422_485     0x00CD
+#define PCI_DEVICE_ID_NEO_2_422_485     0x00CE
+#define PCIE_DEVICE_ID_NEO_8            0x00F0
+#define PCIE_DEVICE_ID_NEO_4            0x00F1
+#define PCIE_DEVICE_ID_NEO_4RJ45        0x00F2
+#define PCIE_DEVICE_ID_NEO_8RJ45        0x00F3
+
 /* Board type definitions */
 
 #define T_NEO		0000
diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c
index a47d882d6743..d2885a7bb090 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -93,12 +93,34 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	/* store the info for the board we've found */
 	brd->boardnum = adapter_count++;
 	brd->pci_dev = pdev;
-	if (pdev->device == PCIE_DEVICE_ID_NEO_4_IBM)
+
+	switch (pdev->device) {
+
+	case PCI_DEVICE_ID_NEO_2DB9:
+	case PCI_DEVICE_ID_NEO_2DB9PRI:
+	case PCI_DEVICE_ID_NEO_2RJ45:
+	case PCI_DEVICE_ID_NEO_2RJ45PRI:
+	case PCI_DEVICE_ID_NEO_2_422_485:
+		brd->maxports = 2;
+		break;
+
+	case PCI_DEVICE_ID_NEO_4:
+	case PCIE_DEVICE_ID_NEO_4:
+	case PCIE_DEVICE_ID_NEO_4RJ45:
+	case PCIE_DEVICE_ID_NEO_4_IBM:
 		brd->maxports = 4;
-	else if (pdev->device == PCI_DEVICE_ID_DIGI_NEO_8)
+		break;
+
+	case PCI_DEVICE_ID_DIGI_NEO_8:
+	case PCIE_DEVICE_ID_NEO_8:
+	case PCIE_DEVICE_ID_NEO_8RJ45:
 		brd->maxports = 8;
-	else
-		brd->maxports = 2;
+		break;
+
+	default:
+		brd->maxports = 1;
+		break;
+	}
 
 	spin_lock_init(&brd->bd_intr_lock);
 
@@ -209,6 +231,14 @@ static struct pci_device_id jsm_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4_IBM), 0, 0, 4 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_NEO_8), 0, 0, 5 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_4), 0, 0, 6 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422), 0, 0, 7 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_1_422_485), 0, 0, 8 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2_422_485), 0, 0, 9 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8), 0, 0, 10 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4), 0, 0, 11 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4RJ45), 0, 0, 12 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_8RJ45), 0, 0, 13 },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, jsm_pci_tbl);
-- 
1.9.3


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

* [Patch v2 2/2] staging: dgnc: remove Neo card ids from device table
  2014-08-30 20:35 ` wfp5p
  (?)
  (?)
@ 2014-08-30 20:35 ` wfp5p
  -1 siblings, 0 replies; 7+ messages in thread
From: wfp5p @ 2014-08-30 20:35 UTC (permalink / raw)
  To: gregkh; +Cc: cascardo, linux-serial, linux-kernel, lidza.louina, devel

From: Bill Pemberton <wfp5p@worldbroken.com>

The Digi Neo cards are supported by the jsm driver.  Remove support
for these cards from dgnc.

Signed-off-by: Bill Pemberton <wfp5p@worldbroken.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 764613b2f4b4..ad07cc698147 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -128,19 +128,6 @@ static struct pci_device_id dgnc_pci_tbl[] = {
 	{	DIGI_VID, PCI_DEVICE_CLASSIC_4_422_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	1 },
 	{	DIGI_VID, PCI_DEVICE_CLASSIC_8_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	2 },
 	{	DIGI_VID, PCI_DEVICE_CLASSIC_8_422_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	3 },
-	{	DIGI_VID, PCI_DEVICE_NEO_4_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,		4 },
-	{	DIGI_VID, PCI_DEVICE_NEO_8_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,		5 },
-	{	DIGI_VID, PCI_DEVICE_NEO_2DB9_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	6 },
-	{	DIGI_VID, PCI_DEVICE_NEO_2DB9PRI_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	7 },
-	{	DIGI_VID, PCI_DEVICE_NEO_2RJ45_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	8 },
-	{	DIGI_VID, PCI_DEVICE_NEO_2RJ45PRI_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	9 },
-	{	DIGI_VID, PCI_DEVICE_NEO_1_422_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	10 },
-	{	DIGI_VID, PCI_DEVICE_NEO_1_422_485_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	11 },
-	{	DIGI_VID, PCI_DEVICE_NEO_2_422_485_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	12 },
-	{	DIGI_VID, PCI_DEVICE_NEO_EXPRESS_8_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	 13 },
-	{	DIGI_VID, PCI_DEVICE_NEO_EXPRESS_4_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	14 },
-	{	DIGI_VID, PCI_DEVICE_NEO_EXPRESS_4RJ45_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	15 },
-	{	DIGI_VID, PCI_DEVICE_NEO_EXPRESS_8RJ45_DID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,	16 },
 	{0,}						/* 0 terminated list. */
 };
 MODULE_DEVICE_TABLE(pci, dgnc_pci_tbl);
-- 
1.9.3


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

* Re: [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm
  2014-08-30 20:35 ` wfp5p
                   ` (2 preceding siblings ...)
  (?)
@ 2014-09-08 20:17 ` Greg KH
  2014-09-08 20:25   ` Bill Pemberton
  -1 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2014-09-08 20:17 UTC (permalink / raw)
  To: wfp5p; +Cc: cascardo, linux-serial, linux-kernel, lidza.louina, devel

On Sat, Aug 30, 2014 at 04:35:56PM -0400, wfp5p@worldbroken.com wrote:
> From: Bill Pemberton <wfp5p@worldbroken.com>
> 
> The jsm driver (drivers/tty/serial/jsm) already supports the Digi Neo
> cards that dgnc (staging) supports.  In fact, it appears that jsm was
> based on dgnc.  The dgnc driver has PCI ids for more cards than jsm,
> this patch moves support for all the Neo cards to jsm.
> 
> The result of this will be that dgnc will only support the Classic
> cards since the jsm driver doesn't support those cards yet.
> 
> 
> Bill Pemberton (2):
>   jsm: add support for additional Neo cards
>   staging: dgnc: remove Neo card ids from device table
> 
>  drivers/staging/dgnc/dgnc_driver.c  | 13 -------------
>  drivers/tty/serial/jsm/jsm.h        | 10 ++++++++++
>  drivers/tty/serial/jsm/jsm_driver.c | 38 +++++++++++++++++++++++++++++++++----
>  3 files changed, 44 insertions(+), 17 deletions(-)

These are now applied, thanks.

Do you think we can delete the dgnc driver now, or are there still some
odd cards out there that it only supports?  What would it take to move
that support to the jsm driver instead?

thanks,

greg k-h

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

* Re: [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm
  2014-09-08 20:17 ` [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm Greg KH
@ 2014-09-08 20:25   ` Bill Pemberton
  2014-09-09 19:13     ` Konrad Zapalowicz
  0 siblings, 1 reply; 7+ messages in thread
From: Bill Pemberton @ 2014-09-08 20:25 UTC (permalink / raw)
  To: Greg KH; +Cc: cascardo, linux-serial, linux-kernel, lidza.louina, devel

On 09/08/2014 04:17 PM, Greg KH wrote:
> On Sat, Aug 30, 2014 at 04:35:56PM -0400, wfp5p@worldbroken.com wrote:
>> From: Bill Pemberton <wfp5p@worldbroken.com>
>>
>> The jsm driver (drivers/tty/serial/jsm) already supports the Digi Neo
>> cards that dgnc (staging) supports.  In fact, it appears that jsm was
>> based on dgnc.  The dgnc driver has PCI ids for more cards than jsm,
>> this patch moves support for all the Neo cards to jsm.
>>
>> The result of this will be that dgnc will only support the Classic
>> cards since the jsm driver doesn't support those cards yet.
>>
>>
>> Bill Pemberton (2):
>>    jsm: add support for additional Neo cards
>>    staging: dgnc: remove Neo card ids from device table
>>
>>   drivers/staging/dgnc/dgnc_driver.c  | 13 -------------
>>   drivers/tty/serial/jsm/jsm.h        | 10 ++++++++++
>>   drivers/tty/serial/jsm/jsm_driver.c | 38 +++++++++++++++++++++++++++++++++----
>>   3 files changed, 44 insertions(+), 17 deletions(-)
>
> These are now applied, thanks.
>
> Do you think we can delete the dgnc driver now, or are there still some
> odd cards out there that it only supports?  What would it take to move
> that support to the jsm driver instead?
>

The jsm driver still doesn't support the Classic cards, just the Neo 
cards so dgnc would still be needed to support those cards.

I think the right thing would be to put the Classic support into jsm. 
I've started looking at that.  Dgnc and jsm are obviously from the same 
base, so dgnc can be used as guide on what to do.  However, I don't have 
a Classic card so I wouldn't be able to test any of the Classic support.

-- 
Bill



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

* Re: [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm
  2014-09-08 20:25   ` Bill Pemberton
@ 2014-09-09 19:13     ` Konrad Zapalowicz
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Zapalowicz @ 2014-09-09 19:13 UTC (permalink / raw)
  To: Bill Pemberton
  Cc: Greg KH, devel, lidza.louina, cascardo, linux-serial, linux-kernel

On 09/08, Bill Pemberton wrote:
> On 09/08/2014 04:17 PM, Greg KH wrote:
> >On Sat, Aug 30, 2014 at 04:35:56PM -0400, wfp5p@worldbroken.com wrote:
> >>From: Bill Pemberton <wfp5p@worldbroken.com>
> >>
> >>The jsm driver (drivers/tty/serial/jsm) already supports the Digi Neo
> >>cards that dgnc (staging) supports.  In fact, it appears that jsm was
> >>based on dgnc.  The dgnc driver has PCI ids for more cards than jsm,
> >>this patch moves support for all the Neo cards to jsm.
> >>
> >>The result of this will be that dgnc will only support the Classic
> >>cards since the jsm driver doesn't support those cards yet.
> >>
> >>
> >>Bill Pemberton (2):
> >>   jsm: add support for additional Neo cards
> >>   staging: dgnc: remove Neo card ids from device table
> >>
> >>  drivers/staging/dgnc/dgnc_driver.c  | 13 -------------
> >>  drivers/tty/serial/jsm/jsm.h        | 10 ++++++++++
> >>  drivers/tty/serial/jsm/jsm_driver.c | 38 +++++++++++++++++++++++++++++++++----
> >>  3 files changed, 44 insertions(+), 17 deletions(-)
> >
> >These are now applied, thanks.
> >
> >Do you think we can delete the dgnc driver now, or are there still some
> >odd cards out there that it only supports?  What would it take to move
> >that support to the jsm driver instead?
> >
> 
> The jsm driver still doesn't support the Classic cards, just the Neo
> cards so dgnc would still be needed to support those cards.
> 
> I think the right thing would be to put the Classic support into
> jsm. I've started looking at that.  Dgnc and jsm are obviously from
> the same base, so dgnc can be used as guide on what to do.  However,
> I don't have a Classic card so I wouldn't be able to test any of the
> Classic support.

I have been working on the dgnc driver for a while now so I add what I
know to this thread.

Bill is right that the jsm and dgnc drivers have the same base, in fact
it seems that the jsm driver is the dgnc driver modified in 2005 by the
kernel folks to be good enough to be accepted. The scope of changes was
to adjust the code to use proper coding style and proper Kernel APIs
plus the ioctls and sysfs stuff was removed as not needed. The dgnc
which is a direct import from the Digi has this features as they are
needed by the Digi folks and their customers (old scripts like the old
APIs).

>From what I know so far about these drivers adding support for the
Classic boards to the jsm driver should not be a big issue. It [more or
less] boils down to adding jsm_cls [aka dgnc_cls] files and having the
logic to assign the proper structure during board discovery.

Would be great to find someone with the Classic card to test it. I tried
to find one but it is damn hard to get.

Hope this helps.

/Konrad
 
> -- 
> Bill
> 
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2014-09-09 19:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-30 20:35 [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm wfp5p
2014-08-30 20:35 ` wfp5p
2014-08-30 20:35 ` [Patch v2 1/2] jsm: add support for additional Neo cards wfp5p
2014-08-30 20:35 ` [Patch v2 2/2] staging: dgnc: remove Neo card ids from device table wfp5p
2014-09-08 20:17 ` [Patch v2 0/2] Move Digi Neo card support from dgnc to jsm Greg KH
2014-09-08 20:25   ` Bill Pemberton
2014-09-09 19:13     ` Konrad Zapalowicz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.