diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ata.h | 6 | ||||
-rw-r--r-- | include/linux/input.h | 3 | ||||
-rw-r--r-- | include/linux/scatterlist.h | 60 |
3 files changed, 38 insertions, 31 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 128dc7ad490..61535e72834 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -43,6 +43,7 @@ enum { ATA_MAX_SECTORS_128 = 128, ATA_MAX_SECTORS = 256, ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ + ATA_MAX_SECTORS_TAPE = 65535, ATA_ID_WORDS = 256, ATA_ID_SERNO = 10, @@ -544,6 +545,11 @@ static inline int atapi_cdb_len(const u16 *dev_id) } } +static inline int atapi_command_packet_set(const u16 *dev_id) +{ + return (dev_id[0] >> 8) & 0x1f; +} + static inline int is_atapi_taskfile(const struct ata_taskfile *tf) { return (tf->protocol == ATA_PROT_ATAPI) || diff --git a/include/linux/input.h b/include/linux/input.h index 62268929856..b45f240a8c4 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -527,6 +527,9 @@ struct input_absinfo { #define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ #define KEY_LOGOFF 0x1b1 /* AL Logoff */ +#define KEY_DOLLAR 0x1b2 +#define KEY_EURO 0x1b3 + #define KEY_DEL_EOL 0x1c0 #define KEY_DEL_EOS 0x1c1 #define KEY_INS_LINE 0x1c2 diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 32326c293d7..25973504414 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -188,43 +188,23 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, /** * sg_mark_end - Mark the end of the scatterlist - * @sgl: Scatterlist - * @nents: Number of entries in sgl + * @sg: SG entryScatterlist * * Description: - * Marks the last entry as the termination point for sg_next() + * Marks the passed in sg entry as the termination point for the sg + * table. A call to sg_next() on this entry will return NULL. * **/ -static inline void sg_mark_end(struct scatterlist *sgl, unsigned int nents) +static inline void sg_mark_end(struct scatterlist *sg) { - sgl[nents - 1].page_link = 0x02; -} - -static inline void __sg_mark_end(struct scatterlist *sg) -{ - sg->page_link |= 0x02; -} - -/** - * sg_init_one - Initialize a single entry sg list - * @sg: SG entry - * @buf: Virtual address for IO - * @buflen: IO length - * - * Notes: - * This should not be used on a single entry that is part of a larger - * table. Use sg_init_table() for that. - * - **/ -static inline void sg_init_one(struct scatterlist *sg, const void *buf, - unsigned int buflen) -{ - memset(sg, 0, sizeof(*sg)); #ifdef CONFIG_DEBUG_SG - sg->sg_magic = SG_MAGIC; + BUG_ON(sg->sg_magic != SG_MAGIC); #endif - sg_mark_end(sg, 1); - sg_set_buf(sg, buf, buflen); + /* + * Set termination bit, clear potential chain bit + */ + sg->page_link |= 0x02; + sg->page_link &= ~0x01; } /** @@ -240,7 +220,6 @@ static inline void sg_init_one(struct scatterlist *sg, const void *buf, static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) { memset(sgl, 0, sizeof(*sgl) * nents); - sg_mark_end(sgl, nents); #ifdef CONFIG_DEBUG_SG { unsigned int i; @@ -248,6 +227,25 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) sgl[i].sg_magic = SG_MAGIC; } #endif + sg_mark_end(&sgl[nents - 1]); +} + +/** + * sg_init_one - Initialize a single entry sg list + * @sg: SG entry + * @buf: Virtual address for IO + * @buflen: IO length + * + * Notes: + * This should not be used on a single entry that is part of a larger + * table. Use sg_init_table() for that. + * + **/ +static inline void sg_init_one(struct scatterlist *sg, const void *buf, + unsigned int buflen) +{ + sg_init_table(sg, 1); + sg_set_buf(sg, buf, buflen); } /** |