Make the driver work on HP8100 and the newer Philips that does not

support the rezero command.
This commit is contained in:
Søren Schmidt 1999-05-11 10:39:27 +00:00
parent 0f7a617de4
commit 3458ae679d
3 changed files with 9 additions and 72 deletions

View file

@ -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.16 1999/04/28 10:52:16 dt Exp $
* $Id: atapi-cd.c,v 1.17 1999/05/07 07:03:23 phk Exp $
*/
#include "wdc.h"
@ -93,7 +93,6 @@ static void acd_describe(struct acd *);
static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char);
static int acd_eject(struct acd *, int);
static void acd_select_slot(struct acd *);
static int acd_rezero_unit(struct acd *);
static int acd_open_disk(struct acd *, int);
static int acd_open_track(struct acd *, struct wormio_prepare_track *);
static int acd_close_track(struct acd *);
@ -411,21 +410,8 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p)
else
++cdp->refcnt;
if ((flags & O_NONBLOCK) == 0) {
if ((flags & FWRITE) != 0) {
/* read/write */
if (acd_rezero_unit(cdp)) {
printf("wcd%d: rezero failed\n", lun);
return EIO;
}
} else {
/* read only */
if (acd_read_toc(cdp) != 0) {
printf("wcd%d: read_toc failed\n", lun);
/* return EIO; */
}
}
}
if (!(flags & O_NONBLOCK) && acd_read_toc(cdp) && !(flags & FWRITE))
printf("acd%d: read_toc failed\n", lun);
return 0;
}
@ -1271,13 +1257,6 @@ acd_select_slot(struct acd *cdp)
}
}
static int
acd_rezero_unit(struct acd *cdp)
{
return acd_request_wait(cdp, ATAPI_REZERO_UNIT, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0);
}
static int
acd_open_disk(struct acd *cdp, int test)
{

View file

@ -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.16 1999/04/28 10:52:16 dt Exp $
* $Id: atapi-cd.c,v 1.17 1999/05/07 07:03:23 phk Exp $
*/
#include "wdc.h"
@ -93,7 +93,6 @@ static void acd_describe(struct acd *);
static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char);
static int acd_eject(struct acd *, int);
static void acd_select_slot(struct acd *);
static int acd_rezero_unit(struct acd *);
static int acd_open_disk(struct acd *, int);
static int acd_open_track(struct acd *, struct wormio_prepare_track *);
static int acd_close_track(struct acd *);
@ -411,21 +410,8 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p)
else
++cdp->refcnt;
if ((flags & O_NONBLOCK) == 0) {
if ((flags & FWRITE) != 0) {
/* read/write */
if (acd_rezero_unit(cdp)) {
printf("wcd%d: rezero failed\n", lun);
return EIO;
}
} else {
/* read only */
if (acd_read_toc(cdp) != 0) {
printf("wcd%d: read_toc failed\n", lun);
/* return EIO; */
}
}
}
if (!(flags & O_NONBLOCK) && acd_read_toc(cdp) && !(flags & FWRITE))
printf("acd%d: read_toc failed\n", lun);
return 0;
}
@ -1271,13 +1257,6 @@ acd_select_slot(struct acd *cdp)
}
}
static int
acd_rezero_unit(struct acd *cdp)
{
return acd_request_wait(cdp, ATAPI_REZERO_UNIT, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0);
}
static int
acd_open_disk(struct acd *cdp, int test)
{

View file

@ -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.16 1999/04/28 10:52:16 dt Exp $
* $Id: atapi-cd.c,v 1.17 1999/05/07 07:03:23 phk Exp $
*/
#include "wdc.h"
@ -93,7 +93,6 @@ static void acd_describe(struct acd *);
static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char);
static int acd_eject(struct acd *, int);
static void acd_select_slot(struct acd *);
static int acd_rezero_unit(struct acd *);
static int acd_open_disk(struct acd *, int);
static int acd_open_track(struct acd *, struct wormio_prepare_track *);
static int acd_close_track(struct acd *);
@ -411,21 +410,8 @@ acdopen(dev_t dev, int flags, int fmt, struct proc *p)
else
++cdp->refcnt;
if ((flags & O_NONBLOCK) == 0) {
if ((flags & FWRITE) != 0) {
/* read/write */
if (acd_rezero_unit(cdp)) {
printf("wcd%d: rezero failed\n", lun);
return EIO;
}
} else {
/* read only */
if (acd_read_toc(cdp) != 0) {
printf("wcd%d: read_toc failed\n", lun);
/* return EIO; */
}
}
}
if (!(flags & O_NONBLOCK) && acd_read_toc(cdp) && !(flags & FWRITE))
printf("acd%d: read_toc failed\n", lun);
return 0;
}
@ -1271,13 +1257,6 @@ acd_select_slot(struct acd *cdp)
}
}
static int
acd_rezero_unit(struct acd *cdp)
{
return acd_request_wait(cdp, ATAPI_REZERO_UNIT, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0);
}
static int
acd_open_disk(struct acd *cdp, int test)
{