summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/i386/isa/atapi-cd.c11
-rw-r--r--sys/i386/isa/atapi-cd.h4
-rw-r--r--sys/i386/isa/wd_cd.c11
-rw-r--r--sys/i386/isa/wd_cd.h4
-rw-r--r--sys/pc98/pc98/wd_cd.c11
5 files changed, 19 insertions, 22 deletions
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c
index 640ed7f..62c168c 100644
--- a/sys/i386/isa/atapi-cd.c
+++ b/sys/i386/isa/atapi-cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.1 1998/09/08 20:57:47 sos Exp $
+ * $Id: atapi-cd.c,v 1.2 1998/10/08 06:41:44 sos Exp $
*/
#include "wdc.h"
@@ -83,7 +83,6 @@ static struct cdevsw acd_cdevsw = {
static struct acd *acdtab[NUNIT];
static int acdnlun = 0; /* Number of configured drives */
-static u_int next_writeable_lba = 0;
#ifndef ATAPI_STATIC
static
@@ -405,7 +404,7 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p)
}
} else {
/* read only */
- if (acd_read_toc(cdp) < 0) {
+ if (acd_read_toc(cdp) != 0) {
printf("acd%d: read_toc failed\n", lun);
/* return EIO; */
}
@@ -536,7 +535,7 @@ acd_start(struct acd *cdp)
lba = bp->b_blkno / (cdp->block_size / DEV_BSIZE);
#endif
else
- lba = next_writeable_lba + (bp->b_offset / cdp->block_size);
+ lba = cdp->next_writeable_lba + (bp->b_offset / cdp->block_size);
blocks = (bp->b_bcount + (cdp->block_size - 1)) / cdp->block_size;
if ((bp->b_flags & B_READ) == B_WRITE) {
@@ -1004,7 +1003,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
break;
if (!track_info.nwa_valid)
return EINVAL;
- next_writeable_lba = track_info.next_writeable_addr;
+ cdp->next_writeable_lba = track_info.next_writeable_addr;
*(int*)addr = track_info.next_writeable_addr;
}
break;
@@ -1274,7 +1273,7 @@ acd_rezero_unit(struct acd *cdp)
static int
acd_open_disk(struct acd *cdp, int test)
{
- next_writeable_lba = 0;
+ cdp->next_writeable_lba = 0;
return 0;
}
diff --git a/sys/i386/isa/atapi-cd.h b/sys/i386/isa/atapi-cd.h
index 29da547..11aaf31 100644
--- a/sys/i386/isa/atapi-cd.h
+++ b/sys/i386/isa/atapi-cd.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.h,v 1.2 1998/09/02 08:47:31 sos Exp sos $
+ * $Id: atapi-cd.h,v 1.1 1998/09/08 20:57:47 sos Exp $
*/
/*
@@ -343,8 +343,8 @@ struct acd {
u_int block_size; /* Blocksize currently used */
u_char dummy; /* Use dummy writes */
u_char speed; /* Select drive speed */
+ u_int next_writeable_lba; /* Next writable position */
struct wormio_prepare_track preptrack; /* Scratch region */
-
#ifdef DEVFS
void *ra_devfs_token;
void *rc_devfs_token;
diff --git a/sys/i386/isa/wd_cd.c b/sys/i386/isa/wd_cd.c
index 640ed7f..62c168c 100644
--- a/sys/i386/isa/wd_cd.c
+++ b/sys/i386/isa/wd_cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.1 1998/09/08 20:57:47 sos Exp $
+ * $Id: atapi-cd.c,v 1.2 1998/10/08 06:41:44 sos Exp $
*/
#include "wdc.h"
@@ -83,7 +83,6 @@ static struct cdevsw acd_cdevsw = {
static struct acd *acdtab[NUNIT];
static int acdnlun = 0; /* Number of configured drives */
-static u_int next_writeable_lba = 0;
#ifndef ATAPI_STATIC
static
@@ -405,7 +404,7 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p)
}
} else {
/* read only */
- if (acd_read_toc(cdp) < 0) {
+ if (acd_read_toc(cdp) != 0) {
printf("acd%d: read_toc failed\n", lun);
/* return EIO; */
}
@@ -536,7 +535,7 @@ acd_start(struct acd *cdp)
lba = bp->b_blkno / (cdp->block_size / DEV_BSIZE);
#endif
else
- lba = next_writeable_lba + (bp->b_offset / cdp->block_size);
+ lba = cdp->next_writeable_lba + (bp->b_offset / cdp->block_size);
blocks = (bp->b_bcount + (cdp->block_size - 1)) / cdp->block_size;
if ((bp->b_flags & B_READ) == B_WRITE) {
@@ -1004,7 +1003,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
break;
if (!track_info.nwa_valid)
return EINVAL;
- next_writeable_lba = track_info.next_writeable_addr;
+ cdp->next_writeable_lba = track_info.next_writeable_addr;
*(int*)addr = track_info.next_writeable_addr;
}
break;
@@ -1274,7 +1273,7 @@ acd_rezero_unit(struct acd *cdp)
static int
acd_open_disk(struct acd *cdp, int test)
{
- next_writeable_lba = 0;
+ cdp->next_writeable_lba = 0;
return 0;
}
diff --git a/sys/i386/isa/wd_cd.h b/sys/i386/isa/wd_cd.h
index 29da547..11aaf31 100644
--- a/sys/i386/isa/wd_cd.h
+++ b/sys/i386/isa/wd_cd.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.h,v 1.2 1998/09/02 08:47:31 sos Exp sos $
+ * $Id: atapi-cd.h,v 1.1 1998/09/08 20:57:47 sos Exp $
*/
/*
@@ -343,8 +343,8 @@ struct acd {
u_int block_size; /* Blocksize currently used */
u_char dummy; /* Use dummy writes */
u_char speed; /* Select drive speed */
+ u_int next_writeable_lba; /* Next writable position */
struct wormio_prepare_track preptrack; /* Scratch region */
-
#ifdef DEVFS
void *ra_devfs_token;
void *rc_devfs_token;
diff --git a/sys/pc98/pc98/wd_cd.c b/sys/pc98/pc98/wd_cd.c
index 640ed7f..62c168c 100644
--- a/sys/pc98/pc98/wd_cd.c
+++ b/sys/pc98/pc98/wd_cd.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atapi-cd.c,v 1.1 1998/09/08 20:57:47 sos Exp $
+ * $Id: atapi-cd.c,v 1.2 1998/10/08 06:41:44 sos Exp $
*/
#include "wdc.h"
@@ -83,7 +83,6 @@ static struct cdevsw acd_cdevsw = {
static struct acd *acdtab[NUNIT];
static int acdnlun = 0; /* Number of configured drives */
-static u_int next_writeable_lba = 0;
#ifndef ATAPI_STATIC
static
@@ -405,7 +404,7 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p)
}
} else {
/* read only */
- if (acd_read_toc(cdp) < 0) {
+ if (acd_read_toc(cdp) != 0) {
printf("acd%d: read_toc failed\n", lun);
/* return EIO; */
}
@@ -536,7 +535,7 @@ acd_start(struct acd *cdp)
lba = bp->b_blkno / (cdp->block_size / DEV_BSIZE);
#endif
else
- lba = next_writeable_lba + (bp->b_offset / cdp->block_size);
+ lba = cdp->next_writeable_lba + (bp->b_offset / cdp->block_size);
blocks = (bp->b_bcount + (cdp->block_size - 1)) / cdp->block_size;
if ((bp->b_flags & B_READ) == B_WRITE) {
@@ -1004,7 +1003,7 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
break;
if (!track_info.nwa_valid)
return EINVAL;
- next_writeable_lba = track_info.next_writeable_addr;
+ cdp->next_writeable_lba = track_info.next_writeable_addr;
*(int*)addr = track_info.next_writeable_addr;
}
break;
@@ -1274,7 +1273,7 @@ acd_rezero_unit(struct acd *cdp)
static int
acd_open_disk(struct acd *cdp, int test)
{
- next_writeable_lba = 0;
+ cdp->next_writeable_lba = 0;
return 0;
}
OpenPOWER on IntegriCloud