summaryrefslogtreecommitdiffstats
path: root/fs/readdir.c
AgeCommit message (Expand)Author
2016-01-22wrappers for ->i_mutex accessAl Viro
2014-10-31vfs: make first argument of dir_context.actor typedMiklos Szeredi
2014-06-04fanotify: create FAN_ACCESS event for readdirHeinrich Schuchardt
2013-10-24file->f_op is never NULL...Al Viro
2013-06-29[readdir] constify ->actorAl Viro
2013-06-29[readdir] ->readdir() is goneAl Viro
2013-06-29[readdir] introduce ->iterate(), ctx->pos, dir_emit()Al Viro
2013-06-29[readdir] introduce iterate_dir() and dir_contextAl Viro
2013-02-22new helper: file_inode(file)Al Viro
2012-09-26switch simple cases of fget_light to fdgetAl Viro
2012-05-29switch readdir/getdents to fget_light/fput_lightAl Viro
2012-02-28fs: reduce the use of module.h wherever possiblePaul Gortmaker
2010-08-09vfs: fix warning: 'dirent' is used uninitialized in this functionKevin Winchester
2009-01-14[CVE-2009-0029] System call wrappers part 32Heiko Carstens
2009-01-14[CVE-2009-0029] System call wrappers part 21Heiko Carstens
2009-01-14[CVE-2009-0029] Rename old_readdir to sys_old_readdirHeiko Carstens
2008-10-23[PATCH] prepare vfs_readdir() callers to returning filldir resultAl Viro
2008-08-25[PATCH] fix regular readdir() and friendsAl Viro
2007-12-06Use mutex_lock_killable in vfs_readdirLiam R. Howlett
2007-05-08ROUND_UP macro cleanup in fs/(select|compat|readdir).cMilind Arun Choudhary
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap
2006-12-08[PATCH] VFS: change struct file to use struct pathJosef "Jeff" Sipek
2006-10-03[PATCH] VFS: Make filldir_t and struct kstat deal in 64-bit inode numbersDavid Howells
2006-01-09[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_semJes Sorensen
2005-04-16Linux-2.6.12-rc2Linus Torvalds
bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 *  HID driver for some cherry "special" devices
 *
 *  Copyright (c) 1999 Andreas Gal
 *  Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
 *  Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
 *  Copyright (c) 2006-2007 Jiri Kosina
 *  Copyright (c) 2008 Jiri Slaby
 */

/*
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 */

#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

/*
 * Cherry Cymotion keyboard have an invalid HID report descriptor,
 * that needs fixing before we can parse it.
 */
static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize)
{
	if (*rsize >= 18 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {
		hid_info(hdev, "fixing up Cherry Cymotion report descriptor\n");
		rdesc[11] = rdesc[16] = 0xff;
		rdesc[12] = rdesc[17] = 0x03;
	}
	return rdesc;
}

#define ch_map_key_clear(c)	hid_map_usage_clear(hi, usage, bit, max, \
					EV_KEY, (c))
static int ch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
		struct hid_field *field, struct hid_usage *usage,
		unsigned long **bit, int *max)
{
	if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER)
		return 0;

	switch (usage->hid & HID_USAGE) {
	case 0x301: ch_map_key_clear(KEY_PROG1);	break;
	case 0x302: ch_map_key_clear(KEY_PROG2);	break;
	case 0x303: ch_map_key_clear(KEY_PROG3);	break;
	default:
		return 0;
	}

	return 1;
}

static const struct hid_device_id ch_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) },
	{ }
};
MODULE_DEVICE_TABLE(hid, ch_devices);

static struct hid_driver ch_driver = {
	.name = "cherry",
	.id_table = ch_devices,
	.report_fixup = ch_report_fixup,
	.input_mapping = ch_input_mapping,
};
module_hid_driver(ch_driver);

MODULE_LICENSE("GPL");