mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Make the driver work on HP8100 and the newer Philips that does not
support the rezero command.
This commit is contained in:
parent
0f7a617de4
commit
3458ae679d
3 changed files with 9 additions and 72 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue