Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 258982 Details for
Bug 294813
net-dialup/openadsl fails to build
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix compilation up to linux 2.6.36
pulsar.patch (text/plain), 5.60 KB, created by
Brian Beardall
on 2011-01-05 21:57:19 UTC
(
hide
)
Description:
patch to fix compilation up to linux 2.6.36
Filename:
MIME Type:
Creator:
Brian Beardall
Created:
2011-01-05 21:57:19 UTC
Size:
5.60 KB
patch
obsolete
>--- pulsar.c 2008/01/29 18:05:54 1.20 >+++ pulsar.c 2010/05/25 18:03:27 1.22 >@@ -25,6 +25,21 @@ > // Wayne Peart - Our Globespan FAE > // Charles Michael Heard - CRC-10 routine > >+/* >+ This program is free software: you can redistribute it and/or modify >+ it under the terms of the GNU General Public License as published by >+ the Free Software Foundation, either version 3 of the License, or >+ (at your option) any later version. >+ >+ This program is distributed in the hope that it will be useful, >+ but WITHOUT ANY WARRANTY; without even the implied warranty of >+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ GNU General Public License for more details. >+ >+ You should have received a copy of the GNU General Public License >+ along with this program. If not, see <http://www.gnu.org/licenses/>. >+ >+*/ > > #include <linux/version.h> > >@@ -339,7 +354,7 @@ > // PDEBUG("%X ",(unsigned int)oam_cell[i]); > // } > //#endif >- PDEBUG("oam_cell at address: %X\n", (unsigned int)oam_cell); >+// PDEBUG("oam_cell at address: %X\n", (unsigned int)oam_cell); > > size = ATM_CELL_SIZE-1; //52 bytes > if (size > MAX_TX_DMA) >@@ -348,7 +363,7 @@ > printk(KERN_WARNING "%s: Tx DMA truncated\n", name); > } > #ifdef DEBUG >- PDEBUG("oam_cell at address: %x\n", (unsigned int)oam_cell); >+// PDEBUG("oam_cell at address: %x\n", (unsigned int)oam_cell); > #endif > spin_lock(&oam_lock); > memcpy(txb, oam_cell, size); >@@ -356,7 +371,7 @@ > oam_cell = NULL; > spin_unlock(&oam_lock); > #ifdef DEBUG >- PDEBUG("oam_cell at address: %X\n", (unsigned int)oam_cell); >+// PDEBUG("oam_cell at address: %X\n", (unsigned int)oam_cell); > #endif > // todo check for left overs > cell_ptr = (u32)txb; >@@ -548,7 +563,7 @@ > } > else { > #ifdef DEBUG >- PDEBUG("oam_cell not NULL!\n"); >+// PDEBUG("oam_cell not NULL!\n"); > PDEBUG("Skipped memcpy\n"); > #endif > } >@@ -950,7 +965,7 @@ > } > > memset(pmodem, 0, sizeof(MODEM_PTR)); >- PDEBUG("oam_cell points to %p\n", oam_cell); >+// PDEBUG("oam_cell points to %p\n", oam_cell); > > sprintf(name, "%s%d", PTAG, index); > >@@ -1094,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; >@@ -1128,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); >@@ -1175,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 */ >@@ -1191,12 +1210,11 @@ > PDEBUG("May Crash Here\n"); > kfree(txb); > kfree(oam_cell); >- PDEBUG("Freed oam_cell\n"); >- PDEBUG("oam_cell = %p\n",oam_cell); >+// PDEBUG("Freed oam_cell\n"); >+// PDEBUG("oam_cell = %p\n",oam_cell); > > kfree(pmodem->handle); > kfree(pmodem); >- > } > > #ifdef PULSAR_NEWPCISTYLE >@@ -1230,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 > } > >@@ -1253,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()); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 294813
:
211310
| 258982