Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46153552 authored by Jeff Garzik's avatar Jeff Garzik
Browse files

Merge branch 'net-const'

parents f90fdc3c f71e1309
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -163,7 +163,7 @@ void do_gettimeofday(struct timeval *tv)
	unsigned long seq;
	unsigned long seq;
	unsigned long lost;
	unsigned long lost;
	unsigned long usec, sec;
	unsigned long usec, sec;
	unsigned long max_ntp_tick = tick_usec - tickadj;
	unsigned long max_ntp_tick;


	do {
	do {
		seq = read_seqbegin(&xtime_lock);
		seq = read_seqbegin(&xtime_lock);
@@ -178,12 +178,13 @@ void do_gettimeofday(struct timeval *tv)
		 * Better to lose some accuracy than have time go backwards..
		 * Better to lose some accuracy than have time go backwards..
		 */
		 */
		if (unlikely(time_adjust < 0)) {
		if (unlikely(time_adjust < 0)) {
			max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj;
			usec = min(usec, max_ntp_tick);
			usec = min(usec, max_ntp_tick);


			if (lost)
			if (lost)
				usec += lost * max_ntp_tick;
				usec += lost * max_ntp_tick;
		} else if (unlikely(lost))
		} else if (unlikely(lost))
			usec += lost * tick_usec;
			usec += lost * (USEC_PER_SEC / HZ);


		sec = xtime.tv_sec;
		sec = xtime.tv_sec;
		usec += (xtime.tv_nsec / 1000);
		usec += (xtime.tv_nsec / 1000);
+21 −3
Original line number Original line Diff line number Diff line
@@ -13,11 +13,12 @@
  *
  *
  * (C) 2000,2001,2002,2003,2004 Omnikey AG
  * (C) 2000,2001,2002,2003,2004 Omnikey AG
  *
  *
  * (C) 2005 Harald Welte <laforge@gnumonks.org>
  * (C) 2005-2006 Harald Welte <laforge@gnumonks.org>
  * 	- Adhere to Kernel CodingStyle
  * 	- Adhere to Kernel CodingStyle
  * 	- Port to 2.6.13 "new" style PCMCIA
  * 	- Port to 2.6.13 "new" style PCMCIA
  * 	- Check for copy_{from,to}_user return values
  * 	- Check for copy_{from,to}_user return values
  * 	- Use nonseekable_open()
  * 	- Use nonseekable_open()
  * 	- add class interface for udev device creation
  *
  *
  * All rights reserved. Licensed under dual BSD/GPL license.
  * All rights reserved. Licensed under dual BSD/GPL license.
  */
  */
@@ -56,7 +57,7 @@ module_param(pc_debug, int, 0600);
#else
#else
#define DEBUGP(n, rdr, x, args...)
#define DEBUGP(n, rdr, x, args...)
#endif
#endif
static char *version = "cm4000_cs.c v2.4.0gm5 - All bugs added by Harald Welte";
static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald Welte";


#define	T_1SEC		(HZ)
#define	T_1SEC		(HZ)
#define	T_10MSEC	msecs_to_jiffies(10)
#define	T_10MSEC	msecs_to_jiffies(10)
@@ -156,6 +157,7 @@ struct cm4000_dev {
		/*queue*/ 4*sizeof(wait_queue_head_t))
		/*queue*/ 4*sizeof(wait_queue_head_t))


static dev_link_t *dev_table[CM4000_MAX_DEV];
static dev_link_t *dev_table[CM4000_MAX_DEV];
static struct class *cmm_class;


/* This table doesn't use spaces after the comma between fields and thus
/* This table doesn't use spaces after the comma between fields and thus
 * violates CodingStyle.  However, I don't really think wrapping it around will
 * violates CodingStyle.  However, I don't really think wrapping it around will
@@ -1937,6 +1939,9 @@ static int cm4000_attach(struct pcmcia_device *p_dev)
	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
	cm4000_config(link, i);
	cm4000_config(link, i);


	class_device_create(cmm_class, NULL, MKDEV(major, i), NULL,
			    "cmm%d", i);

	return 0;
	return 0;
}
}


@@ -1962,6 +1967,8 @@ static void cm4000_detach(struct pcmcia_device *p_dev)
	dev_table[devno] = NULL;
	dev_table[devno] = NULL;
 	kfree(dev);
 	kfree(dev);


	class_device_destroy(cmm_class, MKDEV(major, devno));

	return;
	return;
}
}


@@ -1995,8 +2002,18 @@ static struct pcmcia_driver cm4000_driver = {


static int __init cmm_init(void)
static int __init cmm_init(void)
{
{
	int rc;

	printk(KERN_INFO "%s\n", version);
	printk(KERN_INFO "%s\n", version);
	pcmcia_register_driver(&cm4000_driver);

	cmm_class = class_create(THIS_MODULE, "cardman_4000");
	if (!cmm_class)
		return -1;

	rc = pcmcia_register_driver(&cm4000_driver);
	if (rc < 0)
		return rc;

	major = register_chrdev(0, DEVICE_NAME, &cm4000_fops);
	major = register_chrdev(0, DEVICE_NAME, &cm4000_fops);
	if (major < 0) {
	if (major < 0) {
		printk(KERN_WARNING MODULE_NAME
		printk(KERN_WARNING MODULE_NAME
@@ -2012,6 +2029,7 @@ static void __exit cmm_exit(void)
	printk(KERN_INFO MODULE_NAME ": unloading\n");
	printk(KERN_INFO MODULE_NAME ": unloading\n");
	pcmcia_unregister_driver(&cm4000_driver);
	pcmcia_unregister_driver(&cm4000_driver);
	unregister_chrdev(major, DEVICE_NAME);
	unregister_chrdev(major, DEVICE_NAME);
	class_destroy(cmm_class);
};
};


module_init(cmm_init);
module_init(cmm_init);
+20 −3
Original line number Original line Diff line number Diff line
@@ -3,12 +3,13 @@
 *
 *
 * (c) 2000-2004 Omnikey AG (http://www.omnikey.com/)
 * (c) 2000-2004 Omnikey AG (http://www.omnikey.com/)
 *
 *
 * (C) 2005 Harald Welte <laforge@gnumonks.org>
 * (C) 2005-2006 Harald Welte <laforge@gnumonks.org>
 * 	- add support for poll()
 * 	- add support for poll()
 * 	- driver cleanup
 * 	- driver cleanup
 * 	- add waitqueues
 * 	- add waitqueues
 * 	- adhere to linux kernel coding style and policies
 * 	- adhere to linux kernel coding style and policies
 * 	- support 2.6.13 "new style" pcmcia interface
 * 	- support 2.6.13 "new style" pcmcia interface
 * 	- add class interface for udev device creation
 *
 *
 * The device basically is a USB CCID compliant device that has been
 * The device basically is a USB CCID compliant device that has been
 * attached to an I/O-Mapped FIFO.
 * attached to an I/O-Mapped FIFO.
@@ -53,7 +54,7 @@ module_param(pc_debug, int, 0600);
#endif
#endif


static char *version =
static char *version =
"OMNIKEY CardMan 4040 v1.1.0gm4 - All bugs added by Harald Welte";
"OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte";


#define	CCID_DRIVER_BULK_DEFAULT_TIMEOUT  	(150*HZ)
#define	CCID_DRIVER_BULK_DEFAULT_TIMEOUT  	(150*HZ)
#define	CCID_DRIVER_ASYNC_POWERUP_TIMEOUT 	(35*HZ)
#define	CCID_DRIVER_ASYNC_POWERUP_TIMEOUT 	(35*HZ)
@@ -67,6 +68,7 @@ static char *version =
static void reader_release(dev_link_t *link);
static void reader_release(dev_link_t *link);


static int major;
static int major;
static struct class *cmx_class;


#define		BS_READABLE	0x01
#define		BS_READABLE	0x01
#define		BS_WRITABLE	0x02
#define		BS_WRITABLE	0x02
@@ -696,6 +698,9 @@ static int reader_attach(struct pcmcia_device *p_dev)
	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
	reader_config(link, i);
	reader_config(link, i);


	class_device_create(cmx_class, NULL, MKDEV(major, i), NULL,
			    "cmx%d", i);

	return 0;
	return 0;
}
}


@@ -721,6 +726,8 @@ static void reader_detach(struct pcmcia_device *p_dev)
	dev_table[devno] = NULL;
	dev_table[devno] = NULL;
	kfree(dev);
	kfree(dev);


	class_device_destroy(cmx_class, MKDEV(major, devno));

	return;
	return;
}
}


@@ -755,8 +762,17 @@ static struct pcmcia_driver reader_driver = {


static int __init cm4040_init(void)
static int __init cm4040_init(void)
{
{
	int rc;

	printk(KERN_INFO "%s\n", version);
	printk(KERN_INFO "%s\n", version);
	pcmcia_register_driver(&reader_driver);
	cmx_class = class_create(THIS_MODULE, "cardman_4040");
	if (!cmx_class)
		return -1;

	rc = pcmcia_register_driver(&reader_driver);
	if (rc < 0)
		return rc;

	major = register_chrdev(0, DEVICE_NAME, &reader_fops);
	major = register_chrdev(0, DEVICE_NAME, &reader_fops);
	if (major < 0) {
	if (major < 0) {
		printk(KERN_WARNING MODULE_NAME
		printk(KERN_WARNING MODULE_NAME
@@ -771,6 +787,7 @@ static void __exit cm4040_exit(void)
	printk(KERN_INFO MODULE_NAME ": unloading\n");
	printk(KERN_INFO MODULE_NAME ": unloading\n");
	pcmcia_unregister_driver(&reader_driver);
	pcmcia_unregister_driver(&reader_driver);
	unregister_chrdev(major, DEVICE_NAME);
	unregister_chrdev(major, DEVICE_NAME);
	class_destroy(cmx_class);
}
}


module_init(cm4040_init);
module_init(cm4040_init);
+1 −0
Original line number Original line Diff line number Diff line
@@ -445,6 +445,7 @@ static struct pcmcia_device_id ide_ids[] = {
	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "PnPIDE", 0x281f1c5d, 0x0c694728),
	PCMCIA_DEVICE_PROD_ID12("PCMCIA", "PnPIDE", 0x281f1c5d, 0x0c694728),
	PCMCIA_DEVICE_PROD_ID12("SHUTTLE TECHNOLOGY LTD.", "PCCARD-IDE/ATAPI Adapter", 0x4a3f0ba0, 0x322560e1),
	PCMCIA_DEVICE_PROD_ID12("SHUTTLE TECHNOLOGY LTD.", "PCCARD-IDE/ATAPI Adapter", 0x4a3f0ba0, 0x322560e1),
	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003),
	PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003),
	PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
	PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e),
	PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e),
+10 −12
Original line number Original line Diff line number Diff line
/*
/*
 * $Id: redboot.c,v 1.18 2005/11/07 11:14:21 gleixner Exp $
 * $Id: redboot.c,v 1.19 2005/12/01 10:03:51 dwmw2 Exp $
 *
 *
 * Parse RedBoot-style Flash Image System (FIS) tables and
 * Parse RedBoot-style Flash Image System (FIS) tables and
 * produce a Linux partition array to match.
 * produce a Linux partition array to match.
@@ -92,10 +92,10 @@ static int parse_redboot_partitions(struct mtd_info *master,
		if (!memcmp(buf[i].name, "FIS directory", 14)) {
		if (!memcmp(buf[i].name, "FIS directory", 14)) {
			/* This is apparently the FIS directory entry for the
			/* This is apparently the FIS directory entry for the
			 * FIS directory itself.  The FIS directory size is
			 * FIS directory itself.  The FIS directory size is
			 * one erase block, if the buf[i].size field is
			 * one erase block; if the buf[i].size field is
			 * swab32(erasesize) then we know we are looking at
			 * swab32(erasesize) then we know we are looking at
			 * a byte swapped FIS directory - swap all the entries!
			 * a byte swapped FIS directory - swap all the entries!
			 * (NOTE: this is 'size' not 'data_length', size is
			 * (NOTE: this is 'size' not 'data_length'; size is
			 * the full size of the entry.)
			 * the full size of the entry.)
			 */
			 */
			if (swab32(buf[i].size) == master->erasesize) {
			if (swab32(buf[i].size) == master->erasesize) {
@@ -104,15 +104,13 @@ static int parse_redboot_partitions(struct mtd_info *master,
					/* The unsigned long fields were written with the
					/* The unsigned long fields were written with the
					 * wrong byte sex, name and pad have no byte sex.
					 * wrong byte sex, name and pad have no byte sex.
					 */
					 */
#					define do_swab32(x) (x) = swab32(x)
					swab32s(&buf[j].flash_base);
					do_swab32(buf[j].flash_base);
					swab32s(&buf[j].mem_base);
					do_swab32(buf[j].mem_base);
					swab32s(&buf[j].size);
					do_swab32(buf[j].size);
					swab32s(&buf[j].entry_point);
					do_swab32(buf[j].entry_point);
					swab32s(&buf[j].data_length);
					do_swab32(buf[j].data_length);
					swab32s(&buf[j].desc_cksum);
					do_swab32(buf[j].desc_cksum);
					swab32s(&buf[j].file_cksum);
					do_swab32(buf[j].file_cksum);
#					undef do_swab32
				}
				}
			}
			}
			break;
			break;
Loading