Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 300047 | Differences between
and this patch

Collapse All | Expand All

(-)ltmodem-20090420.orig/Makefile (+1 lines)
Lines 13-18 Link Here
13
all: modules
13
all: modules
14
14
15
modules:
15
modules:
16
	echo > .ltmdmobj.o_.cmd
16
	$(MAKE) -C $(KBUILD_DIR) M="$(MSRC_DIR)"  modules
17
	$(MAKE) -C $(KBUILD_DIR) M="$(MSRC_DIR)"  modules
17
18
18
install:
19
install:
(-)ltmodem-20090420.orig/lib.c (-2 / +2 lines)
Lines 71-80 Link Here
71
71
72
#define LT_DEFINE_PCI_OP(rw,size,type)							\
72
#define LT_DEFINE_PCI_OP(rw,size,type)							\
73
asmlinkage									\
73
asmlinkage									\
74
int lt_pcibios_##rw##_config_##size(unsigned char bus, unsigned char dev_fn,	\
74
int lt_pcibios_##rw##_config_##size(struct pci_bus *bus, unsigned int dev_fn,	\
75
				  unsigned char where, unsigned type val)	\
75
				  unsigned char where, unsigned type val)	\
76
{										\
76
{										\
77
	struct pci_dev *pcidev = pci_find_slot(bus, dev_fn);			\
77
	struct pci_dev *pcidev = pci_get_slot(bus, dev_fn);			\
78
	if (!pcidev)								\
78
	if (!pcidev)								\
79
		return PCIBIOS_DEVICE_NOT_FOUND;				\
79
		return PCIBIOS_DEVICE_NOT_FOUND;				\
80
	return pci_##rw##_config_##size(pcidev, where, val);			\
80
	return pci_##rw##_config_##size(pcidev, where, val);			\
(-)ltmodem-20090420.orig/ltdrv.c (-16 / +27 lines)
Lines 24-29 Link Here
24
#  define ASSERT(cond, action) 	do {} while (0)
24
#  define ASSERT(cond, action) 	do {} while (0)
25
#endif 	
25
#endif 	
26
26
27
void dump_core_vars(void);
27
28
28
struct martian_metrics {
29
struct martian_metrics {
29
	unsigned BaseAddress;
30
	unsigned BaseAddress;
Lines 58-64 Link Here
58
	write_vuart_port(offset, value);
59
	write_vuart_port(offset, value);
59
}
60
}
60
61
61
void dump_core_vars(void );
62
static void serial_startup(struct vuart_host *host)
62
static void serial_startup(struct vuart_host *host)
63
{
63
{
64
	vxdPortOpen();
64
	vxdPortOpen();
Lines 78-93 Link Here
78
	.sleep	  = NULL
78
	.sleep	  = NULL
79
};
79
};
80
80
81
static unsigned int init_vport(struct _ltmodem *ltdev)
81
static unsigned int init_vport(struct vuart_config *conf, struct _ltmodem *ltdev)
82
{
82
{
83
	struct vuart_config conf = {
84
		.type	= VUART_GENERIC,
85
		.flags	= VPF_INTERRUPT
86
	};
87
	
88
	ltdev->host.ops = &lt_uart_ops; 
83
	ltdev->host.ops = &lt_uart_ops; 
89
84
90
	return serial_v8250_register_port(&conf, &ltdev->host);
85
	return serial_v8250_register_port(conf, &ltdev->host);
91
}
86
}
92
87
93
88
Lines 95-107 Link Here
95
static irqreturn_t ltmodem_isr(int irq, void *_dev)
90
static irqreturn_t ltmodem_isr(int irq, void *_dev)
96
{
91
{
97
	struct _ltmodem *dev = (struct _ltmodem *)_dev;
92
	struct _ltmodem *dev = (struct _ltmodem *)_dev;
98
	int handled = 1;
99
93
100
	spin_lock (&dev->lock);
94
	spin_lock (&dev->lock);
95
	local_irq_disable();
101
	dp_dsp_isr();
96
	dp_dsp_isr();
97
	local_irq_enable();
102
	spin_unlock (&dev->lock);
98
	spin_unlock (&dev->lock);
103
99
104
	return IRQ_RETVAL(handled);
100
	return IRQ_HANDLED;
105
}
101
}
106
102
107
asmlinkage u8 dp_regread(u8 reg)
103
asmlinkage u8 dp_regread(u8 reg)
Lines 144-151 Link Here
144
			UART_background();
140
			UART_background();
145
141
146
		if (VMODEM_Timer_Active) {
142
		if (VMODEM_Timer_Active) {
147
			/* conditional ? */
143
			/* conditional ?
148
			struct _ltmodem *ltdev = (struct _ltmodem *)arg;
144
			struct _ltmodem *ltdev = (struct _ltmodem *)arg;
145
			*/
149
			serial_v8250_interrupt(ltmodem.line);
146
			serial_v8250_interrupt(ltmodem.line);
150
		}
147
		}
151
148
Lines 163-168 Link Here
163
	schedule_delayed_work (&ltmodem.work, HZ/100);
160
	schedule_delayed_work (&ltmodem.work, HZ/100);
164
}
161
}
165
162
163
#ifdef DEBUG
166
#define	DUMP_CORE_VAR(var)	pr_info("martian: \t" #var "\t= %d\n", var)
164
#define	DUMP_CORE_VAR(var)	pr_info("martian: \t" #var "\t= %d\n", var)
167
void dump_core_vars(void )
165
void dump_core_vars(void )
168
{
166
{
Lines 178-183 Link Here
178
	DUMP_CORE_VAR(Irq);
176
	DUMP_CORE_VAR(Irq);
179
	DUMP_CORE_VAR(S[0x7e]);
177
	DUMP_CORE_VAR(S[0x7e]);
180
}
178
}
179
#else
180
void dump_core_vars(void) {}
181
#endif /* DEBUG */
181
182
182
static void init_core(struct martian_metrics *mconf)
183
static void init_core(struct martian_metrics *mconf)
183
{
184
{
Lines 206-211 Link Here
206
struct _ltmodem *ltmodem_add (struct martian_metrics *metrics, int *error)
207
struct _ltmodem *ltmodem_add (struct martian_metrics *metrics, int *error)
207
{
208
{
208
	struct _ltmodem *dev = &ltmodem;
209
	struct _ltmodem *dev = &ltmodem;
210
	struct vuart_config vconf = {
211
		.type   = VUART_GENERIC,
212
		.flags  = VPF_INTERRUPT,
213
		.irq    = metrics->irq,
214
		.iobase = metrics->CommAddress
215
	};
209
	int ret;
216
	int ret;
210
217
211
	dev->irq = metrics->irq;
218
	dev->irq = metrics->irq;
Lines 217-223 Link Here
217
	ret = request_irq(
224
	ret = request_irq(
218
		dev->irq, 
225
		dev->irq, 
219
		ltmodem_isr,  
226
		ltmodem_isr,  
220
		IRQF_DISABLED | IRQF_SHARED, 
227
		IRQF_SHARED,
221
		"ltmodem", 
228
		"ltmodem", 
222
		dev
229
		dev
223
	);
230
	);
Lines 230-239 Link Here
230
	INIT_DELAYED_WORK(&dev->work, work_func);
237
	INIT_DELAYED_WORK(&dev->work, work_func);
231
238
232
	init_core(metrics); //, dev);
239
	init_core(metrics); //, dev);
233
	dev->line = init_vport(dev);
240
	dev->line = init_vport(&vconf, dev);
234
	
241
	
235
	pr_info("martian: added device %x:%x " 
242
	pr_info("ltmodem: added device %x:%x, base=0x%x, comm=0x%x, irq=%d\n",
236
			"BaseAddress = 0x%x, CommAddres = 0x%x, irq = %d\n", 
237
			metrics->vendor, metrics->device, 
243
			metrics->vendor, metrics->device, 
238
			metrics->BaseAddress, metrics->CommAddress,
244
			metrics->BaseAddress, metrics->CommAddress,
239
			metrics->irq
245
			metrics->irq
Lines 366-371 Link Here
366
		goto err_disable_pci;
372
		goto err_disable_pci;
367
	}
373
	}
368
374
375
	if (pci_request_regions(dev, "ltmodem")) {
376
		MERROR("failed to register device i/o space\n");
377
		goto err_disable_pci;
378
	}
379
369
	pci_set_drvdata (dev, ltdev);
380
	pci_set_drvdata (dev, ltdev);
370
381
371
	selected = 1;
382
	selected = 1;
Lines 385-390 Link Here
385
		serial_v8250_unregister_port(ltdev->line);
396
		serial_v8250_unregister_port(ltdev->line);
386
		free_irq(ltdev->irq, ltdev);
397
		free_irq(ltdev->irq, ltdev);
387
	}
398
	}
399
	pci_release_regions(dev);
388
	pci_disable_device(dev);
400
	pci_disable_device(dev);
389
}
401
}
390
402
Lines 404-410 Link Here
404
416
405
static int __init ltmodem_init (void) 
417
static int __init ltmodem_init (void) 
406
{
418
{
407
	pr_info("ltmodem loaded\n");
408
	detach_from_serial(ltmodem_ids);
419
	detach_from_serial(ltmodem_ids);
409
	return pci_register_driver (&ltmodem_driver);
420
	return pci_register_driver (&ltmodem_driver);
410
}
421
}
(-)ltmodem-20090420.orig/v8250.c (-7 / +7 lines)
Lines 178-184 Link Here
178
static void
178
static void
179
receive_chars(struct vuart_8250_port *up, unsigned int *status)
179
receive_chars(struct vuart_8250_port *up, unsigned int *status)
180
{
180
{
181
	struct tty_struct *tty = up->port.info->port.tty;
181
	struct tty_struct *tty = up->port.state->port.tty;
182
	unsigned char ch, lsr = *status;
182
	unsigned char ch, lsr = *status;
183
	int max_count = 256;
183
	int max_count = 256;
184
	char flag;
184
	char flag;
Lines 240-246 Link Here
240
240
241
static void transmit_chars(struct vuart_8250_port *up)
241
static void transmit_chars(struct vuart_8250_port *up)
242
{
242
{
243
	struct circ_buf *xmit = &up->port.info->xmit;
243
	struct circ_buf *xmit = &up->port.state->xmit;
244
	int count;
244
	int count;
245
245
246
	if (up->port.x_char) {
246
	if (up->port.x_char) {
Lines 281-287 Link Here
281
	unsigned int status = serial_in(up, UART_MSR);
281
	unsigned int status = serial_in(up, UART_MSR);
282
282
283
	if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && 
283
	if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && 
284
	    up->port.info != NULL) {
284
	    up->port.state != NULL) {
285
		if (status & UART_MSR_TERI)
285
		if (status & UART_MSR_TERI)
286
			up->port.icount.rng++;
286
			up->port.icount.rng++;
287
		if (status & UART_MSR_DDSR)
287
		if (status & UART_MSR_DDSR)
Lines 291-297 Link Here
291
		if (status & UART_MSR_DCTS)
291
		if (status & UART_MSR_DCTS)
292
			uart_handle_cts_change(&up->port, status & UART_MSR_CTS);
292
			uart_handle_cts_change(&up->port, status & UART_MSR_CTS);
293
293
294
		wake_up_interruptible(&up->port.info->delta_msr_wait);
294
		wake_up_interruptible(&up->port.state->port.delta_msr_wait);
295
	}
295
	}
296
296
297
	return status;
297
	return status;
Lines 736-742 Link Here
736
736
737
static struct uart_driver serial8250_reg = {
737
static struct uart_driver serial8250_reg = {
738
	.owner			= THIS_MODULE,
738
	.owner			= THIS_MODULE,
739
	.driver_name		= "serial",
739
	.driver_name		= "vserial",
740
	.dev_name		= "ttySV",
740
	.dev_name		= "ttySV",
741
	.major			= TTY_MAJOR,
741
	.major			= TTY_MAJOR,
742
	.minor			= 64 + CONFIG_SERIAL_8250_NR_UARTS,
742
	.minor			= 64 + CONFIG_SERIAL_8250_NR_UARTS,
Lines 832-840 Link Here
832
832
833
		uart->vtype	    = conf->type;
833
		uart->vtype	    = conf->type;
834
		uart->port.iotype   = UPIO_PORT;
834
		uart->port.iotype   = UPIO_PORT;
835
		uart->port.iobase   = 0xf0000000;		/* imaginary ioport */
835
		uart->port.iobase   = conf->iobase;
836
		uart->port.membase  = 0;
836
		uart->port.membase  = 0;
837
		uart->port.irq      = 0;
837
		uart->port.irq      = conf->irq;
838
		uart->port.mapbase  = 0;
838
		uart->port.mapbase  = 0;
839
		uart->port.uartclk  = 921600 * 16;
839
		uart->port.uartclk  = 921600 * 16;
840
		uart->port.regshift = 0;
840
		uart->port.regshift = 0;
(-)ltmodem-20090420.orig/v8250.h (+2 lines)
Lines 1-6 Link Here
1
struct vuart_config {
1
struct vuart_config {
2
	unsigned int type;
2
	unsigned int type;
3
	unsigned int flags;
3
	unsigned int flags;
4
	unsigned int irq;
5
	unsigned int iobase;
4
};
6
};
5
7
6
struct vuart_host;
8
struct vuart_host;

Return to bug 300047