tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Implement mode_select for atapi tape drives - round 4



On Sun, 9 Aug 2009, Iain Hibbert wrote:

On Sat, 8 Aug 2009, Paul Goyette wrote:

Further comment/criticism is certainly welcomed.  In the absence of any
objection, I'd like to commit this in the next 7 to 10 days.

+/*
+ * Send a filled out parameter structure to the drive to
+ * set it into the desire modes etc.
+ */
+int
+st_mode_select(struct st_softc *st, int flags)
+{
+       u_int select_len;
+       struct select {
+               struct scsi_mode_parameter_header_6 header;
+               struct scsi_general_block_descriptor blk_desc;
+               u_char sense_data[MAX_PAGE_0_SIZE];
+       } select;
+       struct scsipi_periph *periph = st->sc_periph;
+
+       select_len = sizeof(select.header) + sizeof(select.blk_desc) +
+                    st->page_0_size;

should select be __packed?

I see it wasn't originally, but the select_len doesn't take into account
any possible padding and the comment implies that this will be sent direct
to the device..

Well, if this one needs to be packed, then there's a lot of other missing __packed stuff, too. I'd rather not mess with this now; it really should be part of a general clean-up (rototill?) of the scsipi code. That is way beyond the scope of this change, in my opinion.


-------------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:      |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul at whooppee.com   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index