| 100 | struct smapi_bios_parameter *); |
| 101 | |
| 102 | static int |
| 103 | smapi_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) |
| 104 | { |
| 105 | struct smapi_softc *sc; |
| 106 | int error; |
| 107 | |
| 108 | error = 0; |
| 109 | sc = devclass_get_softc(smapi_devclass, dev2unit(dev)); |
| 110 | if (sc == NULL) { |
| 111 | error = ENXIO; |
| 112 | goto fail; |
| 113 | } |
| 114 | |
| 115 | switch (cmd) { |
| 116 | case SMAPIOGHEADER: |
| 117 | bcopy((caddr_t)sc->header, data, |
| 118 | sizeof(struct smapi_bios_header)); |
| 119 | error = 0; |
| 120 | break; |
| 121 | case SMAPIOCGFUNCTION: |
| 122 | smapi32_offset = sc->smapi32_entry; |
| 123 | error = smapi32((struct smapi_bios_parameter *)data, |
| 124 | (struct smapi_bios_parameter *)data); |
| 125 | break; |
| 126 | default: |
| 127 | error = ENOTTY; |
| 128 | } |
| 129 | |
| 130 | fail: |
| 131 | return (error); |
| 132 | } |
| 133 | |
| 134 | static int |
| 135 | smapi_header_cksum (struct smapi_bios_header *header) |
nothing calls this directly
no test coverage detected