[haiku-commits] haiku: hrev46469 - in src/add-ons/kernel/busses/ata: legacy_sata generic_ide_pci

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 1 Dec 2013 21:14:36 +0100 (CET)

hrev46469 adds 4 changesets to branch 'master'
old head: e551626f40c89e7ff5dcac8ce368690fcf382375
new head: 0efca1ac8da7037f05e32afa35f0f86286c2879a
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=0efca1a+%5Ee551626

----------------------------------------------------------------------------

0121ba0: legacy_sata: use PCI_command_int_disable from PCI.h

e83ea9f: ahci: removes supports_device trace.

86003b2: legacy_sata: c -> cpp, minor style cleanup

0efca1a: generic_ide_pci: c -> cpp, minor style cleanup

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

5 files changed, 64 insertions(+), 43 deletions(-)
.../kernel/busses/ata/generic_ide_pci/Jamfile    |  2 +-
.../{generic_ide_pci.c => generic_ide_pci.cpp}   | 31 ++++++---
.../kernel/busses/ata/legacy_sata/Jamfile        |  3 +-
.../{legacy_sata.c => legacy_sata.cpp}           | 66 +++++++++++---------
src/add-ons/kernel/busses/scsi/ahci/ahci.c       |  5 +-

############################################################################

Commit:      0121ba0845f22280888fca66c4dfe9c90718ca3e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=0121ba0
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Nov 30 10:03:50 2013 UTC

legacy_sata: use PCI_command_int_disable from PCI.h

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.c 
b/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.c
index bf52a96..2df8255 100644
--- a/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.c
+++ b/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.c
@@ -45,8 +45,6 @@
 
 #define ID(v,d) (((v)<< 16) | (d))
 
-/* XXX: To be moved to PCI.h */
-#define PCI_command_interrupt  0x400
 
 static const char * const kChannelNames[] = {
        "Primary Channel", "Secondary Channel",
@@ -153,7 +151,7 @@ controller_probe(device_node *parent)
 
        /* enable PCI interrupt */
        pci->write_pci_config(device, PCI_command, 2,
-               pci->read_pci_config(device, PCI_command, 2) & 
~PCI_command_interrupt);
+               pci->read_pci_config(device, PCI_command, 2) & 
~PCI_command_int_disable);
 
        if (vendor_id == PCI_vendor_NVIDIA) {
                /* enable control access */

############################################################################

Commit:      e83ea9f8181ddbe2652e1bb67a425e5094ee3da6
URL:         http://cgit.haiku-os.org/haiku/commit/?id=e83ea9f
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Nov 30 10:11:07 2013 UTC

ahci: removes supports_device trace.

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/busses/scsi/ahci/ahci.c 
b/src/add-ons/kernel/busses/scsi/ahci/ahci.c
index 89327a3..789dbba 100644
--- a/src/add-ons/kernel/busses/scsi/ahci/ahci.c
+++ b/src/add-ons/kernel/busses/scsi/ahci/ahci.c
@@ -10,7 +10,8 @@
 
 
 #define TRACE(a...) dprintf("ahci: " a)
-#define FLOW(a...)     dprintf("ahci: " a)
+//#define FLOW(a...)   dprintf("ahci: " a)
+#define FLOW(a...)
 
 #define AHCI_ID_GENERATOR "ahci/id"
 #define AHCI_ID_ITEM "ahci/id"
@@ -210,7 +211,7 @@ ahci_supports_device(device_node *parent)
        const char *name;
        const char *bus;
 
-       TRACE("ahci_supports_device\n");
+       FLOW("ahci_supports_device\n");
 
        if (gDeviceManager->get_attr_string(parent, B_DEVICE_BUS, &bus, false)
                        < B_OK)

############################################################################

Commit:      86003b2dbcd389cd21716752d62c7bfa31be2edb
URL:         http://cgit.haiku-os.org/haiku/commit/?id=86003b2
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Nov 30 11:45:03 2013 UTC

legacy_sata: c -> cpp, minor style cleanup

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.c 
b/src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.cpp
similarity index 100%
rename from src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.c
rename to src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.cpp
diff --git a/src/add-ons/kernel/busses/ata/legacy_sata/Jamfile 
b/src/add-ons/kernel/busses/ata/legacy_sata/Jamfile
index 691cd31..7c14cf5 100644
--- a/src/add-ons/kernel/busses/ata/legacy_sata/Jamfile
+++ b/src/add-ons/kernel/busses/ata/legacy_sata/Jamfile
@@ -3,6 +3,5 @@ SubDir HAIKU_TOP src add-ons kernel busses ata legacy_sata ;
 UsePrivateHeaders drivers kernel ;
 
 KernelAddon legacy_sata :
-       legacy_sata.c
+       legacy_sata.cpp
        ;
-
diff --git a/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.c 
b/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.cpp
similarity index 85%
rename from src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.c
rename to src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.cpp
index 2df8255..8334ed8 100644
--- a/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.c
+++ b/src/add-ons/kernel/busses/ata/legacy_sata/legacy_sata.cpp
@@ -3,10 +3,13 @@
  * Distributed under the terms of the MIT License.
  */
 
+
+#include <ata_adapter.h>
 #include <KernelExport.h>
+#include <PCI_x86.h>
+
 #include <stdlib.h>
 #include <string.h>
-#include <ata_adapter.h>
 
 
 #define DRIVER_PRETTY_NAME     "Legacy SATA"
@@ -232,15 +235,14 @@ controller_init(device_node *node, void 
**controller_cookie)
 static void
 controller_uninit(void *controller_cookie)
 {
-       sATAAdapter->uninit_controller(controller_cookie);
+       
sATAAdapter->uninit_controller((ata_adapter_controller_info*)controller_cookie);
 }
 
 
 static void
 controller_removed(void *controller_cookie)
 {
-       sATAAdapter->controller_removed(
-               (ata_adapter_controller_info*)controller_cookie);
+       
sATAAdapter->controller_removed((ata_adapter_controller_info*)controller_cookie);
 }
 
 
@@ -249,92 +251,100 @@ channel_init(device_node *node, void **channel_cookie)
 {
        return sATAAdapter->init_channel(node,
                (ata_adapter_channel_info**)channel_cookie,
-               sizeof(ata_adapter_channel_info),
-               sATAAdapter->inthand);
+               sizeof(ata_adapter_channel_info), sATAAdapter->inthand);
 }
 
 
 static void
 channel_uninit(void *channel_cookie)
 {
-       sATAAdapter->uninit_channel(channel_cookie);
+       sATAAdapter->uninit_channel((ata_adapter_channel_info*)channel_cookie);
 }
 
 
 static void
 channel_removed(void *channel_cookie)
 {
-       sATAAdapter->channel_removed(channel_cookie);
+       sATAAdapter->channel_removed((ata_adapter_channel_info*)channel_cookie);
 }
 
 
 static void
-channel_set(void *cookie, ata_channel channel)
+channel_set(void *channel_cookie, ata_channel channel)
 {
-       sATAAdapter->set_channel((ata_adapter_channel_info *)cookie, channel);
+       sATAAdapter->set_channel((ata_adapter_channel_info*)channel_cookie,
+               channel);
 }
 
 
 static status_t
 task_file_write(void *channel_cookie, ata_task_file *tf, ata_reg_mask mask)
 {
-       return sATAAdapter->write_command_block_regs(channel_cookie,tf,mask);
+       return sATAAdapter->write_command_block_regs(
+               (ata_adapter_channel_info*)channel_cookie, tf, mask);
 }
 
 
 static status_t
 task_file_read(void *channel_cookie, ata_task_file *tf, ata_reg_mask mask)
 {
-       return sATAAdapter->read_command_block_regs(channel_cookie,tf,mask);
+       return sATAAdapter->read_command_block_regs(
+               (ata_adapter_channel_info*)channel_cookie, tf, mask);
 }
 
 
 static uint8
 altstatus_read(void *channel_cookie)
 {
-       return sATAAdapter->get_altstatus(channel_cookie);
+       return sATAAdapter->get_altstatus(
+               (ata_adapter_channel_info*)channel_cookie);
 }
 
 
 static status_t
 device_control_write(void *channel_cookie, uint8 val)
 {
-       return sATAAdapter->write_device_control(channel_cookie,val);
+       return sATAAdapter->write_device_control(
+               (ata_adapter_channel_info*)channel_cookie, val);
 }
 
 
 static status_t
 pio_write(void *channel_cookie, uint16 *data, int count, bool force_16bit)
 {
-       return sATAAdapter->write_pio(channel_cookie,data,count,force_16bit);
+       return sATAAdapter->write_pio((ata_adapter_channel_info*)channel_cookie,
+               data, count, force_16bit);
 }
 
 
 static status_t
 pio_read(void *channel_cookie, uint16 *data, int count, bool force_16bit)
 {
-       return sATAAdapter->read_pio(channel_cookie,data,count,force_16bit);
+       return sATAAdapter->read_pio((ata_adapter_channel_info*)channel_cookie,
+               data, count, force_16bit);
 }
 
 
 static status_t
-dma_prepare(void *channel_cookie, const physical_entry *sg_list, size_t 
sg_list_count, bool write)
+dma_prepare(void *channel_cookie, const physical_entry *sg_list,
+       size_t sg_list_count, bool write)
 {
-       return 
sATAAdapter->prepare_dma(channel_cookie,sg_list,sg_list_count,write);
+       return 
sATAAdapter->prepare_dma((ata_adapter_channel_info*)channel_cookie,
+               sg_list, sg_list_count, write);
 }
 
 
 static status_t
 dma_start(void *channel_cookie)
 {
-       return sATAAdapter->start_dma(channel_cookie);
+       return 
sATAAdapter->start_dma((ata_adapter_channel_info*)channel_cookie);
 }
 
 
 static status_t
 dma_finish(void *channel_cookie)
 {
-       return sATAAdapter->finish_dma(channel_cookie);
+       return 
sATAAdapter->finish_dma((ata_adapter_channel_info*)channel_cookie);
 }
 
 
@@ -385,11 +395,13 @@ static driver_module_info sControllerInterface = {
                NULL
        },
 
-       .init_driver            = &controller_init,
-       .uninit_driver          = &controller_uninit,
-       .supports_device        = &controller_supports,
-       .register_device        = &controller_probe,
-       .device_removed         = &controller_removed,
+       controller_supports,
+       controller_probe,
+       controller_init,
+       controller_uninit,
+       NULL,   // register child devices
+       NULL,   // rescan
+       controller_removed,
 };
 
 module_info *modules[] = {

############################################################################

Revision:    hrev46469
Commit:      0efca1ac8da7037f05e32afa35f0f86286c2879a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=0efca1a
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Nov 30 11:56:32 2013 UTC

generic_ide_pci: c -> cpp, minor style cleanup

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/busses/ata/generic_ide_pci/Jamfile 
b/src/add-ons/kernel/busses/ata/generic_ide_pci/Jamfile
index 961fda3..7613617 100644
--- a/src/add-ons/kernel/busses/ata/generic_ide_pci/Jamfile
+++ b/src/add-ons/kernel/busses/ata/generic_ide_pci/Jamfile
@@ -3,5 +3,5 @@ SubDir HAIKU_TOP src add-ons kernel busses ata generic_ide_pci ;
 UsePrivateHeaders drivers kernel ;
 
 KernelAddon generic_ide_pci :
-       generic_ide_pci.c
+       generic_ide_pci.cpp
        ;
diff --git a/src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.cpp 
b/src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.cpp
index bf8dca5..7154c20 100644
--- a/src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.cpp
+++ b/src/add-ons/kernel/busses/ata/generic_ide_pci/generic_ide_pci.cpp
@@ -5,11 +5,13 @@
 
 /*!    Generic PCI bus mastering IDE driver. */
 
+
+#include <ata_adapter.h>
 #include <KernelExport.h>
+
 #include <stdlib.h>
 #include <string.h>
 
-#include <ata_adapter.h>
 
 #define GENERIC_IDE_PCI_CONTROLLER_MODULE_NAME 
"busses/ata/generic_ide_pci/driver_v1"
 #define GENERIC_IDE_PCI_CHANNEL_MODULE_NAME 
"busses/ata/generic_ide_pci/channel/v1"
@@ -29,44 +31,52 @@ set_channel(void *cookie, ata_channel channel)
 
 
 static status_t
-write_command_block_regs(void *channel_cookie, ata_task_file *tf, ata_reg_mask 
mask)
+write_command_block_regs(void *channel_cookie, ata_task_file *tf,
+       ata_reg_mask mask)
 {
-       return sATAAdapter->write_command_block_regs((ata_adapter_channel_info 
*)channel_cookie, tf, mask);
+       return sATAAdapter->write_command_block_regs(
+               (ata_adapter_channel_info *)channel_cookie, tf, mask);
 }
 
 
 static status_t
-read_command_block_regs(void *channel_cookie, ata_task_file *tf, ata_reg_mask 
mask)
+read_command_block_regs(void *channel_cookie, ata_task_file *tf,
+       ata_reg_mask mask)
 {
-       return sATAAdapter->read_command_block_regs((ata_adapter_channel_info 
*)channel_cookie, tf, mask);
+       return sATAAdapter->read_command_block_regs(
+               (ata_adapter_channel_info *)channel_cookie, tf, mask);
 }
 
 
 static uint8
 get_altstatus(void *channel_cookie)
 {
-       return sATAAdapter->get_altstatus((ata_adapter_channel_info 
*)channel_cookie);
+       return sATAAdapter->get_altstatus(
+               (ata_adapter_channel_info *)channel_cookie);
 }
 
 
 static status_t
 write_device_control(void *channel_cookie, uint8 val)
 {
-       return sATAAdapter->write_device_control((ata_adapter_channel_info 
*)channel_cookie, val);
+       return sATAAdapter->write_device_control(
+               (ata_adapter_channel_info *)channel_cookie, val);
 }
 
 
 static status_t
 write_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
 {
-       return sATAAdapter->write_pio((ata_adapter_channel_info 
*)channel_cookie, data, count, force_16bit);
+       return sATAAdapter->write_pio((ata_adapter_channel_info 
*)channel_cookie,
+               data, count, force_16bit);
 }
 
 
 static status_t
 read_pio(void *channel_cookie, uint16 *data, int count, bool force_16bit)
 {
-       return sATAAdapter->read_pio((ata_adapter_channel_info 
*)channel_cookie, data, count, force_16bit);
+       return sATAAdapter->read_pio((ata_adapter_channel_info *)channel_cookie,
+               data, count, force_16bit);
 }
 
 
@@ -75,7 +85,8 @@ prepare_dma(void *channel_cookie,
        const physical_entry *sg_list, size_t sg_list_count,
        bool to_device)
 {
-       return sATAAdapter->prepare_dma((ata_adapter_channel_info 
*)channel_cookie, sg_list, sg_list_count, to_device);
+       return sATAAdapter->prepare_dma((ata_adapter_channel_info 
*)channel_cookie,
+               sg_list, sg_list_count, to_device);
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev46469 - in src/add-ons/kernel/busses/ata: legacy_sata generic_ide_pci - korli