[Midnightbsd-cvs] src [9069] trunk/sys/dev/ata: add more ifdefs

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Oct 1 06:14:23 EDT 2016


Revision: 9069
          http://svnweb.midnightbsd.org/src/?rev=9069
Author:   laffer1
Date:     2016-10-01 06:14:23 -0400 (Sat, 01 Oct 2016)
Log Message:
-----------
add more ifdefs

Modified Paths:
--------------
    trunk/sys/dev/ata/ata-all.c
    trunk/sys/dev/ata/ata-all.h

Modified: trunk/sys/dev/ata/ata-all.c
===================================================================
--- trunk/sys/dev/ata/ata-all.c	2016-10-01 10:13:58 UTC (rev 9068)
+++ trunk/sys/dev/ata/ata-all.c	2016-10-01 10:14:23 UTC (rev 9069)
@@ -166,9 +166,11 @@
     ch->state = ATA_IDLE;
     bzero(&ch->state_mtx, sizeof(struct mtx));
     mtx_init(&ch->state_mtx, "ATA state lock", NULL, MTX_DEF);
+#ifndef ATA_CAM
     bzero(&ch->queue_mtx, sizeof(struct mtx));
     mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF);
     TAILQ_INIT(&ch->ata_queue);
+#endif
     TASK_INIT(&ch->conntask, 0, ata_conn_event, dev);
 #ifdef ATA_CAM
 	for (i = 0; i < 16; i++) {
@@ -340,7 +342,9 @@
 	ch->dma.free(dev);
 
     mtx_destroy(&ch->state_mtx);
+#ifndef ATA_CAM
     mtx_destroy(&ch->queue_mtx);
+#endif
     return 0;
 }
 
@@ -1107,6 +1111,7 @@
     ch->r_io[ATA_ALTSTAT].offset = ch->r_io[ATA_CONTROL].offset;
 }
 
+#ifndef ATA_CAM
 void
 ata_modify_if_48bit(struct ata_request *request)
 {
@@ -1208,6 +1213,7 @@
 	request->flags |= ATA_R_48BIT;
     }
 }
+#endif
 
 void
 ata_udelay(int interval)
@@ -1453,7 +1459,7 @@
 #endif
 
 #ifdef ATA_CAM
-void
+static void
 ata_cam_begin_transaction(device_t dev, union ccb *ccb)
 {
 	struct ata_channel *ch = device_get_softc(dev);

Modified: trunk/sys/dev/ata/ata-all.h
===================================================================
--- trunk/sys/dev/ata/ata-all.h	2016-10-01 10:13:58 UTC (rev 9068)
+++ trunk/sys/dev/ata/ata-all.h	2016-10-01 10:14:23 UTC (rev 9069)
@@ -579,9 +579,11 @@
 #define         ATA_ACTIVE              0x0001
 #define         ATA_STALL_QUEUE         0x0002
 
+#ifndef ATA_CAM
     struct mtx                  queue_mtx;      /* queue lock */
     TAILQ_HEAD(, ata_request)   ata_queue;      /* head of ATA queue */
     struct ata_request          *freezepoint;   /* composite freezepoint */
+#endif
     struct ata_request          *running;       /* currently running request */
     struct task			conntask;	/* PHY events handling task */
 #ifdef ATA_CAM
@@ -620,24 +622,24 @@
 void ata_interrupt(void *data);
 int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data);
 int ata_getparam(struct ata_device *atadev, int init);
-int ata_identify(device_t dev);
 void ata_default_registers(device_t dev);
-void ata_modify_if_48bit(struct ata_request *request);
 void ata_udelay(int interval);
 const char *ata_unit2str(struct ata_device *atadev);
 const char *ata_mode2str(int mode);
+void ata_setmode(device_t dev);
+void ata_print_cable(device_t dev, u_int8_t *who);
 int ata_str2mode(const char *str);
 const char *ata_satarev2str(int rev);
 int ata_atapi(device_t dev, int target);
+#ifndef ATA_CAM
+int ata_identify(device_t dev);
+void ata_modify_if_48bit(struct ata_request *request);
 int ata_pmode(struct ata_params *ap);
 int ata_wmode(struct ata_params *ap);
 int ata_umode(struct ata_params *ap);
 int ata_limit_mode(device_t dev, int mode, int maxmode);
-void ata_setmode(device_t dev);
-void ata_print_cable(device_t dev, u_int8_t *who);
 int ata_check_80pin(device_t dev, int mode);
-#ifdef ATA_CAM
-void ata_cam_begin_transaction(device_t dev, union ccb *ccb);
+#else
 void ata_cam_end_transaction(device_t dev, struct ata_request *request);
 #endif
 



More information about the Midnightbsd-cvs mailing list