Revision: 6347
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6347&view=rev
Author:   owes
Date:     2012-02-16 21:01:26 +0000 (Thu, 16 Feb 2012)
Log Message:
-----------
Add pulsar patches to be able to build with 3.0 kernel

Modified Paths:
--------------
    ipcop/trunk/lfs/pulsar

Added Paths:
-----------
    ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.33.patch
    ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.37.patch
    ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.39.patch

Modified: ipcop/trunk/lfs/pulsar
===================================================================
--- ipcop/trunk/lfs/pulsar      2012-02-16 20:59:27 UTC (rev 6346)
+++ ipcop/trunk/lfs/pulsar      2012-02-16 21:01:26 UTC (rev 6347)
@@ -86,6 +86,9 @@
 
        cd $(DIR_APP) && cp makefile.2.6 Makefile
        cd $(DIR_APP) && patch -Np1 -i 
$(DIR_PATCHES)/pulsar-4.0.24_kernel_2.6.24.patch
+       cd $(DIR_APP) && patch -Np1 -i 
$(DIR_PATCHES)/pulsar-4.0.24_kernel_2.6.33.patch
+       cd $(DIR_APP) && patch -Np1 -i 
$(DIR_PATCHES)/pulsar-4.0.24_kernel_2.6.37.patch
+       cd $(DIR_APP) && patch -Np1 -i 
$(DIR_PATCHES)/pulsar-4.0.24_kernel_2.6.39.patch
        cd $(DIR_APP) && make KDIR=/lib/modules/$(KVER)/build
 
        cd $(DIR_APP) && install -D -m 0644 pulsar_atm.ko 
/lib/modules/$(KVER)/extra/pulsar.ko

Added: ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.33.patch
===================================================================
--- ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.33.patch                   
        (rev 0)
+++ ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.33.patch   2012-02-16 
21:01:26 UTC (rev 6347)
@@ -0,0 +1,114 @@
+--- a/pulsar.c 2008/09/15 01:18:09     1.21
++++ b/pulsar.c 2010/05/25 18:03:27     1.22
+@@ -1109,19 +1109,16 @@
+ 
+       /* Get MAC address */           // XXX: Todo
+ 
+-      /* Start training modem */
+-
+       /* Create /proc/pulsar/pulsarX */
+       sprintf(proc_name, "driver/pulsar/pulsar%d", dev_number);
+-      pulsar_proc = create_proc_read_entry(proc_name, 0, 
NULL,pulsar_read_procmem,NULL);
+-      if (pulsar_proc == NULL){ //failed to create proc file, therefore 
directory /proc/driver/pulsar doesn't exist
+-        pulsar_dir = proc_mkdir("driver/pulsar", NULL); //create the missing 
directory
+-        pulsar_proc = create_proc_read_entry(proc_name, 0, 
NULL,pulsar_read_procmem,NULL); //try to create file again
+-      }
+-      if ((pulsar_proc == NULL) && (pulsar_dir != NULL)){
+-        remove_proc_entry("driver/pulsar",NULL); //still failed, so give up 
and remove directory.
++      pulsar_dir = proc_mkdir("driver/pulsar", NULL);
++      if (pulsar_dir) {
++              pulsar_proc = create_proc_read_entry(proc_name, 0, NULL, 
pulsar_read_procmem, NULL);
++              if (!pulsar_proc)
++                      remove_proc_entry("driver/pulsar",NULL);
+       }
+ 
++      /* Start training modem */
+       start_training(pmodem);
+       err = 0;
+       goto pulsar_init_exit;
+@@ -1143,6 +1140,9 @@
+       pci_disable_device(pci_dev);
+ pulsar_init_exit_free:
+       pci_set_drvdata(pci_dev, NULL);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
++      pci_dev_put(pci_dev);
++#endif
+       kfree(txb);
+       kfree(oam_cell); 
+       kfree(pmodem->handle);
+@@ -1190,6 +1190,10 @@
+ #endif
+       pci_disable_device(pci_dev);
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++      pci_dev_put(pci_dev);
++#endif
++
+       //sarlib_close(vcc_list);
+       
+       /* Remove /proc/driver/pulsar/pulsarX */
+@@ -1211,7 +1215,6 @@
+       
+       kfree(pmodem->handle);
+       kfree(pmodem);
+-      
+ }     
+ 
+ #ifdef PULSAR_NEWPCISTYLE
+@@ -1245,20 +1248,23 @@
+ 
+       printk(KERN_INFO "%s: PCI ADSL ATM Driver %s Lib %s loaded\n", PTAG, 
VERSION, getlibver());
+ 
++      printk(KERN_INFO "%s: Searching for card %d\n", PTAG, dev_number);
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++      while ((pci_dev = pci_get_device(VID, DID, pci_dev)) != NULL) {
++#else
+       while ((pci_dev = pci_find_device(VID, DID, pci_dev)) != NULL) {
++#endif
+               if (dev_found == dev_number) // we've found the one were 
looking for
+-                      break;
++                      return pulsar_init_one(pci_dev, NULL);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++              pci_dev_put(pci_dev);
++#endif
+               dev_found++;
+       }
+ 
+-      printk(KERN_DEBUG "%s: dev_found = %d, dev_number = %d\n", PTAG, 
dev_found, dev_number);
+-
+-      if ((pci_dev) && (dev_found == dev_number)) {
+-              return pulsar_init_one(pci_dev, NULL);
+-      } else {
+-              printk(KERN_ERR "%s: No PCI card found\n", PTAG);
+-              return -ENODEV;
+-      }
++      printk(KERN_ERR "%s: No card found\n", PTAG);
++      return -ENODEV;
+ #endif
+ }
+ 
+@@ -1268,9 +1274,21 @@
+       pci_unregister_driver(&pulsar_driver);
+ #else
+       struct pci_dev *pci_dev = NULL;
++      int dev_found = 0;
+ 
+-      pci_dev = pci_find_device(VID, DID, pci_dev); // just one device at the 
moment
+-      pulsar_remove_one(pci_dev);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++      while ((pci_dev = pci_get_device(VID, DID, pci_dev)) != NULL) {
++#else
++      while ((pci_dev = pci_find_device(VID, DID, pci_dev)) != NULL) {
++#endif
++              if (dev_found == dev_number)
++                      pulsar_remove_one(pci_dev);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++              else
++                      pci_dev_put(pci_dev);
++#endif
++              dev_found++;
++      }
+ #endif
+       printk(KERN_INFO "%s: PCI ADSL ATM Driver %s Lib %s unloaded\n", PTAG, 
VERSION, getlibver());
+ }

Added: ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.37.patch
===================================================================
--- ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.37.patch                   
        (rev 0)
+++ ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.37.patch   2012-02-16 
21:01:26 UTC (rev 6347)
@@ -0,0 +1,14 @@
+--- a/pulsar.c 2010/05/25 18:03:27     1.22
++++ b/pulsar.c 2011/02/11 19:01:08     1.23
+@@ -1045,7 +1045,11 @@
+                       name, pci_dev, pci_dev->irq, membase, memlen);
+       
+       /* Register ATM device */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
++      atmdev = atm_dev_register(name, &pci_dev->dev, &pulsar_ops, -1, NULL);
++#else
+       atmdev = atm_dev_register(name, &pulsar_ops, -1, NULL);
++#endif
+       if (!atmdev) {
+               printk(KERN_ERR "%s: Could not register ATM device\n", name);
+               err = -ENODEV;
\ No newline at end of file

Added: ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.39.patch
===================================================================
--- ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.39.patch                   
        (rev 0)
+++ ipcop/trunk/src/patches/pulsar-4.0.24_kernel_2.6.39.patch   2012-02-16 
21:01:26 UTC (rev 6347)
@@ -0,0 +1,20 @@
+--- a/pulsar.c 2011/02/11 19:01:08     1.23
++++ b/pulsar.c 2011/05/19 18:15:35     1.24
+@@ -110,10 +110,17 @@
+ static unsigned char *oam_cell = NULL;
+ 
+ static int retrain_timer;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
++DEFINE_SPINLOCK(oam_lock);
++DEFINE_SPINLOCK(rx_lock);
++DEFINE_SPINLOCK(timer_lock);
++static DEFINE_SPINLOCK(tx_lock);
++#else
+ spinlock_t oam_lock = SPIN_LOCK_UNLOCKED;
+ spinlock_t rx_lock = SPIN_LOCK_UNLOCKED;
+ spinlock_t timer_lock = SPIN_LOCK_UNLOCKED;
+ static spinlock_t tx_lock = SPIN_LOCK_UNLOCKED;
++#endif
+ CBUF_STRUCT rx_cbuf[RX_CBUF_SIZE];
+ int rx_head=0, rx_tail=0;
+ static int tx_dma_count = 0;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to