fdc.c (f36cfd49adb62472fd7009ecd4f0927c126ff785) | fdc.c (a3a10d1c3cb3b68e98aefae1f43890f09568c734) |
---|---|
1/* 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Don Ahn. 7 * 8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu) --- 2586 unchanged lines hidden (view full) --- 2595 if (fd->ft == 0) 2596 /* no type known yet, return the native type */ 2597 *(struct fd_type *)addr = fd_native_types[fd->type]; 2598 else 2599 *(struct fd_type *)addr = *fd->ft; 2600 return (0); 2601 2602 case FD_STYPE: /* set drive type */ | 1/* 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Don Ahn. 7 * 8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu) --- 2586 unchanged lines hidden (view full) --- 2595 if (fd->ft == 0) 2596 /* no type known yet, return the native type */ 2597 *(struct fd_type *)addr = fd_native_types[fd->type]; 2598 else 2599 *(struct fd_type *)addr = *fd->ft; 2600 return (0); 2601 2602 case FD_STYPE: /* set drive type */ |
2603 if (suser(td) != 0) 2604 return (EPERM); | 2603 /* 2604 * Allow setting drive type temporarily iff 2605 * currently unset. Used for fdformat so any 2606 * user can set it, and then start formatting. 2607 */ 2608 if (fd->ft) 2609 return (EINVAL); /* already set */ |
2605 fd->fts[0] = *(struct fd_type *)addr; | 2610 fd->fts[0] = *(struct fd_type *)addr; |
2611 fd->ft = &fd->fts[0]; 2612 fd->flags |= FD_UA; |
|
2606 return (0); 2607 2608 case FD_GOPTS: /* get drive options */ 2609 *(int *)addr = fd->options + FDOPT_AUTOSEL; 2610 return (0); 2611 2612 case FD_SOPTS: /* set drive options */ 2613 fd->options = *(int *)addr & ~FDOPT_AUTOSEL; --- 106 unchanged lines hidden --- | 2613 return (0); 2614 2615 case FD_GOPTS: /* get drive options */ 2616 *(int *)addr = fd->options + FDOPT_AUTOSEL; 2617 return (0); 2618 2619 case FD_SOPTS: /* set drive options */ 2620 fd->options = *(int *)addr & ~FDOPT_AUTOSEL; --- 106 unchanged lines hidden --- |