diff options
author | Uwe Bugla <uwe.bugla@gmx.de> | 2009-03-29 07:13:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:47 -0400 |
commit | 91b94366260fc4d960713c2e76e0fc874ff76992 (patch) | |
tree | 2ee05f5097ea007ac43f7a4fe23e77ea5273ee7b /drivers/media/dvb | |
parent | 1589a993f074124c3edfff03656e910bb472eeaa (diff) |
V4L/DVB (11288): Code cleanup (passes checkpatch now) of the b2c2-flexcop-drivers 2/2
This is the second part of the code cleanup changing the usb and pci-driver cores.
Signed-off-by: Uwe Bugla <uwe.bugla@gmx.de>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-pci.c | 164 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-usb.c | 368 |
2 files changed, 281 insertions, 251 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c index 84d2252045c8..227c0200b70a 100644 --- a/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/drivers/media/dvb/b2c2/flexcop-pci.c | |||
@@ -1,9 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * This file is part of linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III | 2 | * Linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III |
3 | * | 3 | * flexcop-pci.c - covers the PCI part including DMA transfers |
4 | * flexcop-pci.c - covers the PCI part including DMA transfers. | 4 | * see flexcop.c for copyright information |
5 | * | ||
6 | * see flexcop.c for copyright information. | ||
7 | */ | 5 | */ |
8 | 6 | ||
9 | #define FC_LOG_PREFIX "flexcop-pci" | 7 | #define FC_LOG_PREFIX "flexcop-pci" |
@@ -11,7 +9,8 @@ | |||
11 | 9 | ||
12 | static int enable_pid_filtering = 1; | 10 | static int enable_pid_filtering = 1; |
13 | module_param(enable_pid_filtering, int, 0444); | 11 | module_param(enable_pid_filtering, int, 0444); |
14 | MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1"); | 12 | MODULE_PARM_DESC(enable_pid_filtering, |
13 | "enable hardware pid filtering: supported values: 0 (fullts), 1"); | ||
15 | 14 | ||
16 | static int irq_chk_intv = 100; | 15 | static int irq_chk_intv = 100; |
17 | module_param(irq_chk_intv, int, 0644); | 16 | module_param(irq_chk_intv, int, 0644); |
@@ -26,17 +25,17 @@ MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog."); | |||
26 | #define DEBSTATUS " (debugging is not enabled)" | 25 | #define DEBSTATUS " (debugging is not enabled)" |
27 | #endif | 26 | #endif |
28 | 27 | ||
29 | #define deb_info(args...) dprintk(0x01,args) | 28 | #define deb_info(args...) dprintk(0x01, args) |
30 | #define deb_reg(args...) dprintk(0x02,args) | 29 | #define deb_reg(args...) dprintk(0x02, args) |
31 | #define deb_ts(args...) dprintk(0x04,args) | 30 | #define deb_ts(args...) dprintk(0x04, args) |
32 | #define deb_irq(args...) dprintk(0x08,args) | 31 | #define deb_irq(args...) dprintk(0x08, args) |
33 | #define deb_chk(args...) dprintk(0x10,args) | 32 | #define deb_chk(args...) dprintk(0x10, args) |
34 | 33 | ||
35 | static int debug; | 34 | static int debug; |
36 | module_param(debug, int, 0644); | 35 | module_param(debug, int, 0644); |
37 | MODULE_PARM_DESC(debug, | 36 | MODULE_PARM_DESC(debug, |
38 | "set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))." | 37 | "set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))." |
39 | DEBSTATUS); | 38 | DEBSTATUS); |
40 | 39 | ||
41 | #define DRIVER_VERSION "0.1" | 40 | #define DRIVER_VERSION "0.1" |
42 | #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" | 41 | #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" |
@@ -51,30 +50,30 @@ struct flexcop_pci { | |||
51 | 50 | ||
52 | void __iomem *io_mem; | 51 | void __iomem *io_mem; |
53 | u32 irq; | 52 | u32 irq; |
54 | /* buffersize (at least for DMA1, need to be % 188 == 0, | 53 | /* buffersize (at least for DMA1, need to be % 188 == 0, |
55 | * this logic is required */ | 54 | * this logic is required */ |
56 | #define FC_DEFAULT_DMA1_BUFSIZE (1280 * 188) | 55 | #define FC_DEFAULT_DMA1_BUFSIZE (1280 * 188) |
57 | #define FC_DEFAULT_DMA2_BUFSIZE (10 * 188) | 56 | #define FC_DEFAULT_DMA2_BUFSIZE (10 * 188) |
58 | struct flexcop_dma dma[2]; | 57 | struct flexcop_dma dma[2]; |
59 | 58 | ||
60 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ | 59 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ |
61 | u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ | 60 | u32 last_dma1_cur_pos; |
61 | /* position of the pointer last time the timer/packet irq occured */ | ||
62 | int count; | 62 | int count; |
63 | int count_prev; | 63 | int count_prev; |
64 | int stream_problem; | 64 | int stream_problem; |
65 | 65 | ||
66 | spinlock_t irq_lock; | 66 | spinlock_t irq_lock; |
67 | |||
68 | unsigned long last_irq; | 67 | unsigned long last_irq; |
69 | 68 | ||
70 | struct delayed_work irq_check_work; | 69 | struct delayed_work irq_check_work; |
71 | |||
72 | struct flexcop_device *fc_dev; | 70 | struct flexcop_device *fc_dev; |
73 | }; | 71 | }; |
74 | 72 | ||
75 | static int lastwreg,lastwval,lastrreg,lastrval; | 73 | static int lastwreg, lastwval, lastrreg, lastrval; |
76 | 74 | ||
77 | static flexcop_ibi_value flexcop_pci_read_ibi_reg (struct flexcop_device *fc, flexcop_ibi_register r) | 75 | static flexcop_ibi_value flexcop_pci_read_ibi_reg(struct flexcop_device *fc, |
76 | flexcop_ibi_register r) | ||
78 | { | 77 | { |
79 | struct flexcop_pci *fc_pci = fc->bus_specific; | 78 | struct flexcop_pci *fc_pci = fc->bus_specific; |
80 | flexcop_ibi_value v; | 79 | flexcop_ibi_value v; |
@@ -82,19 +81,20 @@ static flexcop_ibi_value flexcop_pci_read_ibi_reg (struct flexcop_device *fc, fl | |||
82 | 81 | ||
83 | if (lastrreg != r || lastrval != v.raw) { | 82 | if (lastrreg != r || lastrval != v.raw) { |
84 | lastrreg = r; lastrval = v.raw; | 83 | lastrreg = r; lastrval = v.raw; |
85 | deb_reg("new rd: %3x: %08x\n",r,v.raw); | 84 | deb_reg("new rd: %3x: %08x\n", r, v.raw); |
86 | } | 85 | } |
87 | 86 | ||
88 | return v; | 87 | return v; |
89 | } | 88 | } |
90 | 89 | ||
91 | static int flexcop_pci_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_register r, flexcop_ibi_value v) | 90 | static int flexcop_pci_write_ibi_reg(struct flexcop_device *fc, |
91 | flexcop_ibi_register r, flexcop_ibi_value v) | ||
92 | { | 92 | { |
93 | struct flexcop_pci *fc_pci = fc->bus_specific; | 93 | struct flexcop_pci *fc_pci = fc->bus_specific; |
94 | 94 | ||
95 | if (lastwreg != r || lastwval != v.raw) { | 95 | if (lastwreg != r || lastwval != v.raw) { |
96 | lastwreg = r; lastwval = v.raw; | 96 | lastwreg = r; lastwval = v.raw; |
97 | deb_reg("new wr: %3x: %08x\n",r,v.raw); | 97 | deb_reg("new wr: %3x: %08x\n", r, v.raw); |
98 | } | 98 | } |
99 | 99 | ||
100 | writel(v.raw, fc_pci->io_mem + r); | 100 | writel(v.raw, fc_pci->io_mem + r); |
@@ -117,12 +117,12 @@ static void flexcop_pci_irq_check_work(struct work_struct *work) | |||
117 | 117 | ||
118 | spin_lock_irq(&fc->demux.lock); | 118 | spin_lock_irq(&fc->demux.lock); |
119 | list_for_each_entry(feed, &fc->demux.feed_list, | 119 | list_for_each_entry(feed, &fc->demux.feed_list, |
120 | list_head) { | 120 | list_head) { |
121 | flexcop_pid_feed_control(fc, feed, 0); | 121 | flexcop_pid_feed_control(fc, feed, 0); |
122 | } | 122 | } |
123 | 123 | ||
124 | list_for_each_entry(feed, &fc->demux.feed_list, | 124 | list_for_each_entry(feed, &fc->demux.feed_list, |
125 | list_head) { | 125 | list_head) { |
126 | flexcop_pid_feed_control(fc, feed, 1); | 126 | flexcop_pid_feed_control(fc, feed, 1); |
127 | } | 127 | } |
128 | spin_unlock_irq(&fc->demux.lock); | 128 | spin_unlock_irq(&fc->demux.lock); |
@@ -150,11 +150,10 @@ static irqreturn_t flexcop_pci_isr(int irq, void *dev_id) | |||
150 | flexcop_ibi_value v; | 150 | flexcop_ibi_value v; |
151 | irqreturn_t ret = IRQ_HANDLED; | 151 | irqreturn_t ret = IRQ_HANDLED; |
152 | 152 | ||
153 | spin_lock_irqsave(&fc_pci->irq_lock,flags); | 153 | spin_lock_irqsave(&fc_pci->irq_lock, flags); |
154 | 154 | v = fc->read_ibi_reg(fc, irq_20c); | |
155 | v = fc->read_ibi_reg(fc,irq_20c); | ||
156 | 155 | ||
157 | /* errors */ | 156 | /* errors */ |
158 | if (v.irq_20c.Data_receiver_error) | 157 | if (v.irq_20c.Data_receiver_error) |
159 | deb_chk("data receiver error\n"); | 158 | deb_chk("data receiver error\n"); |
160 | if (v.irq_20c.Continuity_error_flag) | 159 | if (v.irq_20c.Continuity_error_flag) |
@@ -165,24 +164,29 @@ static irqreturn_t flexcop_pci_isr(int irq, void *dev_id) | |||
165 | deb_chk("Transport error\n"); | 164 | deb_chk("Transport error\n"); |
166 | 165 | ||
167 | if ((fc_pci->count % 1000) == 0) | 166 | if ((fc_pci->count % 1000) == 0) |
168 | deb_chk("%d valid irq took place so far\n",fc_pci->count); | 167 | deb_chk("%d valid irq took place so far\n", fc_pci->count); |
169 | 168 | ||
170 | if (v.irq_20c.DMA1_IRQ_Status == 1) { | 169 | if (v.irq_20c.DMA1_IRQ_Status == 1) { |
171 | if (fc_pci->active_dma1_addr == 0) | 170 | if (fc_pci->active_dma1_addr == 0) |
172 | flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr0,fc_pci->dma[0].size / 188); | 171 | flexcop_pass_dmx_packets(fc_pci->fc_dev, |
172 | fc_pci->dma[0].cpu_addr0, | ||
173 | fc_pci->dma[0].size / 188); | ||
173 | else | 174 | else |
174 | flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr1,fc_pci->dma[0].size / 188); | 175 | flexcop_pass_dmx_packets(fc_pci->fc_dev, |
176 | fc_pci->dma[0].cpu_addr1, | ||
177 | fc_pci->dma[0].size / 188); | ||
175 | 178 | ||
176 | deb_irq("page change to page: %d\n",!fc_pci->active_dma1_addr); | 179 | deb_irq("page change to page: %d\n",!fc_pci->active_dma1_addr); |
177 | fc_pci->active_dma1_addr = !fc_pci->active_dma1_addr; | 180 | fc_pci->active_dma1_addr = !fc_pci->active_dma1_addr; |
178 | } else if (v.irq_20c.DMA1_Timer_Status == 1) { | ||
179 | /* for the timer IRQ we only can use buffer dmx feeding, because we don't have | 181 | /* for the timer IRQ we only can use buffer dmx feeding, because we don't have |
180 | * complete TS packets when reading from the DMA memory */ | 182 | * complete TS packets when reading from the DMA memory */ |
183 | } else if (v.irq_20c.DMA1_Timer_Status == 1) { | ||
181 | dma_addr_t cur_addr = | 184 | dma_addr_t cur_addr = |
182 | fc->read_ibi_reg(fc,dma1_008).dma_0x8.dma_cur_addr << 2; | 185 | fc->read_ibi_reg(fc,dma1_008).dma_0x8.dma_cur_addr << 2; |
183 | u32 cur_pos = cur_addr - fc_pci->dma[0].dma_addr0; | 186 | u32 cur_pos = cur_addr - fc_pci->dma[0].dma_addr0; |
184 | 187 | ||
185 | deb_irq("%u irq: %08x cur_addr: %llx: cur_pos: %08x, last_cur_pos: %08x ", | 188 | deb_irq("%u irq: %08x cur_addr: %llx: cur_pos: %08x, " |
189 | "last_cur_pos: %08x ", | ||
186 | jiffies_to_usecs(jiffies - fc_pci->last_irq), | 190 | jiffies_to_usecs(jiffies - fc_pci->last_irq), |
187 | v.raw, (unsigned long long)cur_addr, cur_pos, | 191 | v.raw, (unsigned long long)cur_addr, cur_pos, |
188 | fc_pci->last_dma1_cur_pos); | 192 | fc_pci->last_dma1_cur_pos); |
@@ -192,30 +196,36 @@ static irqreturn_t flexcop_pci_isr(int irq, void *dev_id) | |||
192 | * pass the data from last_cur_pos to the buffer end to the demux | 196 | * pass the data from last_cur_pos to the buffer end to the demux |
193 | */ | 197 | */ |
194 | if (cur_pos < fc_pci->last_dma1_cur_pos) { | 198 | if (cur_pos < fc_pci->last_dma1_cur_pos) { |
195 | deb_irq(" end was reached: passing %d bytes ",(fc_pci->dma[0].size*2 - 1) - fc_pci->last_dma1_cur_pos); | 199 | deb_irq(" end was reached: passing %d bytes ", |
200 | (fc_pci->dma[0].size*2 - 1) - | ||
201 | fc_pci->last_dma1_cur_pos); | ||
196 | flexcop_pass_dmx_data(fc_pci->fc_dev, | 202 | flexcop_pass_dmx_data(fc_pci->fc_dev, |
197 | fc_pci->dma[0].cpu_addr0 + fc_pci->last_dma1_cur_pos, | 203 | fc_pci->dma[0].cpu_addr0 + |
198 | (fc_pci->dma[0].size*2) - fc_pci->last_dma1_cur_pos); | 204 | fc_pci->last_dma1_cur_pos, |
205 | (fc_pci->dma[0].size*2) - | ||
206 | fc_pci->last_dma1_cur_pos); | ||
199 | fc_pci->last_dma1_cur_pos = 0; | 207 | fc_pci->last_dma1_cur_pos = 0; |
200 | } | 208 | } |
201 | 209 | ||
202 | if (cur_pos > fc_pci->last_dma1_cur_pos) { | 210 | if (cur_pos > fc_pci->last_dma1_cur_pos) { |
203 | deb_irq(" passing %d bytes ",cur_pos - fc_pci->last_dma1_cur_pos); | 211 | deb_irq(" passing %d bytes ", |
212 | cur_pos - fc_pci->last_dma1_cur_pos); | ||
204 | flexcop_pass_dmx_data(fc_pci->fc_dev, | 213 | flexcop_pass_dmx_data(fc_pci->fc_dev, |
205 | fc_pci->dma[0].cpu_addr0 + fc_pci->last_dma1_cur_pos, | 214 | fc_pci->dma[0].cpu_addr0 + |
206 | cur_pos - fc_pci->last_dma1_cur_pos); | 215 | fc_pci->last_dma1_cur_pos, |
216 | cur_pos - fc_pci->last_dma1_cur_pos); | ||
207 | } | 217 | } |
208 | deb_irq("\n"); | 218 | deb_irq("\n"); |
209 | 219 | ||
210 | fc_pci->last_dma1_cur_pos = cur_pos; | 220 | fc_pci->last_dma1_cur_pos = cur_pos; |
211 | fc_pci->count++; | 221 | fc_pci->count++; |
212 | } else { | 222 | } else { |
213 | deb_irq("isr for flexcop called, apparently without reason (%08x)\n",v.raw); | 223 | deb_irq("isr for flexcop called, " |
224 | "apparently without reason (%08x)\n", v.raw); | ||
214 | ret = IRQ_NONE; | 225 | ret = IRQ_NONE; |
215 | } | 226 | } |
216 | 227 | ||
217 | spin_unlock_irqrestore(&fc_pci->irq_lock,flags); | 228 | spin_unlock_irqrestore(&fc_pci->irq_lock, flags); |
218 | |||
219 | return ret; | 229 | return ret; |
220 | } | 230 | } |
221 | 231 | ||
@@ -223,52 +233,48 @@ static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff) | |||
223 | { | 233 | { |
224 | struct flexcop_pci *fc_pci = fc->bus_specific; | 234 | struct flexcop_pci *fc_pci = fc->bus_specific; |
225 | if (onoff) { | 235 | if (onoff) { |
226 | flexcop_dma_config(fc,&fc_pci->dma[0],FC_DMA_1); | 236 | flexcop_dma_config(fc, &fc_pci->dma[0], FC_DMA_1); |
227 | flexcop_dma_config(fc,&fc_pci->dma[1],FC_DMA_2); | 237 | flexcop_dma_config(fc, &fc_pci->dma[1], FC_DMA_2); |
228 | 238 | flexcop_dma_config_timer(fc, FC_DMA_1, 0); | |
229 | flexcop_dma_config_timer(fc,FC_DMA_1,0); | 239 | flexcop_dma_xfer_control(fc, FC_DMA_1, |
230 | 240 | FC_DMA_SUBADDR_0 | FC_DMA_SUBADDR_1, 1); | |
231 | flexcop_dma_xfer_control(fc,FC_DMA_1,FC_DMA_SUBADDR_0 | FC_DMA_SUBADDR_1,1); | ||
232 | deb_irq("DMA xfer enabled\n"); | 241 | deb_irq("DMA xfer enabled\n"); |
233 | 242 | ||
234 | fc_pci->last_dma1_cur_pos = 0; | 243 | fc_pci->last_dma1_cur_pos = 0; |
235 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,1); | 244 | flexcop_dma_control_timer_irq(fc, FC_DMA_1, 1); |
236 | deb_irq("IRQ enabled\n"); | 245 | deb_irq("IRQ enabled\n"); |
237 | |||
238 | fc_pci->count_prev = fc_pci->count; | 246 | fc_pci->count_prev = fc_pci->count; |
239 | |||
240 | // fc_pci->active_dma1_addr = 0; | ||
241 | // flexcop_dma_control_size_irq(fc,FC_DMA_1,1); | ||
242 | |||
243 | } else { | 247 | } else { |
244 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,0); | 248 | flexcop_dma_control_timer_irq(fc, FC_DMA_1, 0); |
245 | deb_irq("IRQ disabled\n"); | 249 | deb_irq("IRQ disabled\n"); |
246 | 250 | ||
247 | // flexcop_dma_control_size_irq(fc,FC_DMA_1,0); | 251 | flexcop_dma_xfer_control(fc, FC_DMA_1, |
248 | 252 | FC_DMA_SUBADDR_0 | FC_DMA_SUBADDR_1, 0); | |
249 | flexcop_dma_xfer_control(fc,FC_DMA_1,FC_DMA_SUBADDR_0 | FC_DMA_SUBADDR_1,0); | ||
250 | deb_irq("DMA xfer disabled\n"); | 253 | deb_irq("DMA xfer disabled\n"); |
251 | } | 254 | } |
252 | |||
253 | return 0; | 255 | return 0; |
254 | } | 256 | } |
255 | 257 | ||
256 | static int flexcop_pci_dma_init(struct flexcop_pci *fc_pci) | 258 | static int flexcop_pci_dma_init(struct flexcop_pci *fc_pci) |
257 | { | 259 | { |
258 | int ret; | 260 | int ret; |
259 | if ((ret = flexcop_dma_allocate(fc_pci->pdev,&fc_pci->dma[0],FC_DEFAULT_DMA1_BUFSIZE)) != 0) | 261 | ret = flexcop_dma_allocate(fc_pci->pdev, &fc_pci->dma[0], |
262 | FC_DEFAULT_DMA1_BUFSIZE); | ||
263 | if (ret != 0) | ||
260 | return ret; | 264 | return ret; |
261 | 265 | ||
262 | if ((ret = flexcop_dma_allocate(fc_pci->pdev,&fc_pci->dma[1],FC_DEFAULT_DMA2_BUFSIZE)) != 0) { | 266 | ret = flexcop_dma_allocate(fc_pci->pdev, &fc_pci->dma[1], |
267 | FC_DEFAULT_DMA2_BUFSIZE); | ||
268 | if (ret != 0) { | ||
263 | flexcop_dma_free(&fc_pci->dma[0]); | 269 | flexcop_dma_free(&fc_pci->dma[0]); |
264 | return ret; | 270 | return ret; |
265 | } | 271 | } |
266 | 272 | ||
267 | flexcop_sram_set_dest(fc_pci->fc_dev,FC_SRAM_DEST_MEDIA | FC_SRAM_DEST_NET, FC_SRAM_DEST_TARGET_DMA1); | 273 | flexcop_sram_set_dest(fc_pci->fc_dev, FC_SRAM_DEST_MEDIA | |
268 | flexcop_sram_set_dest(fc_pci->fc_dev,FC_SRAM_DEST_CAO | FC_SRAM_DEST_CAI, FC_SRAM_DEST_TARGET_DMA2); | 274 | FC_SRAM_DEST_NET, FC_SRAM_DEST_TARGET_DMA1); |
269 | 275 | flexcop_sram_set_dest(fc_pci->fc_dev, FC_SRAM_DEST_CAO | | |
276 | FC_SRAM_DEST_CAI, FC_SRAM_DEST_TARGET_DMA2); | ||
270 | fc_pci->init_state |= FC_PCI_DMA_INIT; | 277 | fc_pci->init_state |= FC_PCI_DMA_INIT; |
271 | |||
272 | return ret; | 278 | return ret; |
273 | } | 279 | } |
274 | 280 | ||
@@ -291,12 +297,8 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci) | |||
291 | 297 | ||
292 | if ((ret = pci_enable_device(fc_pci->pdev)) != 0) | 298 | if ((ret = pci_enable_device(fc_pci->pdev)) != 0) |
293 | return ret; | 299 | return ret; |
294 | |||
295 | pci_set_master(fc_pci->pdev); | 300 | pci_set_master(fc_pci->pdev); |
296 | 301 | ||
297 | /* enable interrupts */ | ||
298 | // pci_write_config_dword(pdev, 0x6c, 0x8000); | ||
299 | |||
300 | if ((ret = pci_request_regions(fc_pci->pdev, DRIVER_NAME)) != 0) | 302 | if ((ret = pci_request_regions(fc_pci->pdev, DRIVER_NAME)) != 0) |
301 | goto err_pci_disable_device; | 303 | goto err_pci_disable_device; |
302 | 304 | ||
@@ -339,8 +341,8 @@ static void flexcop_pci_exit(struct flexcop_pci *fc_pci) | |||
339 | fc_pci->init_state &= ~FC_PCI_INIT; | 341 | fc_pci->init_state &= ~FC_PCI_INIT; |
340 | } | 342 | } |
341 | 343 | ||
342 | 344 | static int flexcop_pci_probe(struct pci_dev *pdev, | |
343 | static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 345 | const struct pci_device_id *ent) |
344 | { | 346 | { |
345 | struct flexcop_device *fc; | 347 | struct flexcop_device *fc; |
346 | struct flexcop_pci *fc_pci; | 348 | struct flexcop_pci *fc_pci; |
@@ -351,7 +353,7 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
351 | return -ENOMEM; | 353 | return -ENOMEM; |
352 | } | 354 | } |
353 | 355 | ||
354 | /* general flexcop init */ | 356 | /* general flexcop init */ |
355 | fc_pci = fc->bus_specific; | 357 | fc_pci = fc->bus_specific; |
356 | fc_pci->fc_dev = fc; | 358 | fc_pci->fc_dev = fc; |
357 | 359 | ||
@@ -359,7 +361,6 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
359 | fc->write_ibi_reg = flexcop_pci_write_ibi_reg; | 361 | fc->write_ibi_reg = flexcop_pci_write_ibi_reg; |
360 | fc->i2c_request = flexcop_i2c_request; | 362 | fc->i2c_request = flexcop_i2c_request; |
361 | fc->get_mac_addr = flexcop_eeprom_check_mac_addr; | 363 | fc->get_mac_addr = flexcop_eeprom_check_mac_addr; |
362 | |||
363 | fc->stream_control = flexcop_pci_stream_control; | 364 | fc->stream_control = flexcop_pci_stream_control; |
364 | 365 | ||
365 | if (enable_pid_filtering) | 366 | if (enable_pid_filtering) |
@@ -369,29 +370,29 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
369 | 370 | ||
370 | fc->pid_filtering = enable_pid_filtering; | 371 | fc->pid_filtering = enable_pid_filtering; |
371 | fc->bus_type = FC_PCI; | 372 | fc->bus_type = FC_PCI; |
372 | |||
373 | fc->dev = &pdev->dev; | 373 | fc->dev = &pdev->dev; |
374 | fc->owner = THIS_MODULE; | 374 | fc->owner = THIS_MODULE; |
375 | 375 | ||
376 | /* bus specific part */ | 376 | /* bus specific part */ |
377 | fc_pci->pdev = pdev; | 377 | fc_pci->pdev = pdev; |
378 | if ((ret = flexcop_pci_init(fc_pci)) != 0) | 378 | if ((ret = flexcop_pci_init(fc_pci)) != 0) |
379 | goto err_kfree; | 379 | goto err_kfree; |
380 | 380 | ||
381 | /* init flexcop */ | 381 | /* init flexcop */ |
382 | if ((ret = flexcop_device_initialize(fc)) != 0) | 382 | if ((ret = flexcop_device_initialize(fc)) != 0) |
383 | goto err_pci_exit; | 383 | goto err_pci_exit; |
384 | 384 | ||
385 | /* init dma */ | 385 | /* init dma */ |
386 | if ((ret = flexcop_pci_dma_init(fc_pci)) != 0) | 386 | if ((ret = flexcop_pci_dma_init(fc_pci)) != 0) |
387 | goto err_fc_exit; | 387 | goto err_fc_exit; |
388 | 388 | ||
389 | INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); | 389 | INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); |
390 | 390 | ||
391 | if (irq_chk_intv > 0) | 391 | if (irq_chk_intv > 0) |
392 | schedule_delayed_work(&fc_pci->irq_check_work, | 392 | schedule_delayed_work(&fc_pci->irq_check_work, |
393 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); | 393 | msecs_to_jiffies(irq_chk_intv < 100 ? |
394 | 394 | 100 : | |
395 | irq_chk_intv)); | ||
395 | return ret; | 396 | return ret; |
396 | 397 | ||
397 | err_fc_exit: | 398 | err_fc_exit: |
@@ -421,7 +422,6 @@ static void flexcop_pci_remove(struct pci_dev *pdev) | |||
421 | 422 | ||
422 | static struct pci_device_id flexcop_pci_tbl[] = { | 423 | static struct pci_device_id flexcop_pci_tbl[] = { |
423 | { PCI_DEVICE(0x13d0, 0x2103) }, | 424 | { PCI_DEVICE(0x13d0, 0x2103) }, |
424 | /* { PCI_DEVICE(0x13d0, 0x2200) }, ? */ | ||
425 | { }, | 425 | { }, |
426 | }; | 426 | }; |
427 | 427 | ||
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c index ae0d76a5d51d..bedcfb671624 100644 --- a/drivers/media/dvb/b2c2/flexcop-usb.c +++ b/drivers/media/dvb/b2c2/flexcop-usb.c | |||
@@ -1,11 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * This file is part of linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III | 2 | * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III |
3 | * | 3 | * flexcop-usb.c - covers the USB part |
4 | * flexcop-usb.c - covers the USB part. | 4 | * see flexcop.c for copyright information |
5 | * | ||
6 | * see flexcop.c for copyright information. | ||
7 | */ | 5 | */ |
8 | |||
9 | #define FC_LOG_PREFIX "flexcop_usb" | 6 | #define FC_LOG_PREFIX "flexcop_usb" |
10 | #include "flexcop-usb.h" | 7 | #include "flexcop-usb.h" |
11 | #include "flexcop-common.h" | 8 | #include "flexcop-common.h" |
@@ -18,42 +15,47 @@ | |||
18 | /* debug */ | 15 | /* debug */ |
19 | #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG | 16 | #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG |
20 | #define dprintk(level,args...) \ | 17 | #define dprintk(level,args...) \ |
21 | do { if ((debug & level)) { printk(args); } } while (0) | 18 | do { if ((debug & level)) printk(args); } while (0) |
22 | #define debug_dump(b,l,method) {\ | 19 | |
20 | #define debug_dump(b, l, method) do {\ | ||
23 | int i; \ | 21 | int i; \ |
24 | for (i = 0; i < l; i++) method("%02x ", b[i]); \ | 22 | for (i = 0; i < l; i++) \ |
25 | method("\n");\ | 23 | method("%02x ", b[i]); \ |
26 | } | 24 | method("\n"); \ |
25 | } while (0) | ||
27 | 26 | ||
28 | #define DEBSTATUS "" | 27 | #define DEBSTATUS "" |
29 | #else | 28 | #else |
30 | #define dprintk(level,args...) | 29 | #define dprintk(level, args...) |
31 | #define debug_dump(b,l,method) | 30 | #define debug_dump(b, l, method) |
32 | #define DEBSTATUS " (debugging is not enabled)" | 31 | #define DEBSTATUS " (debugging is not enabled)" |
33 | #endif | 32 | #endif |
34 | 33 | ||
35 | static int debug; | 34 | static int debug; |
36 | module_param(debug, int, 0644); | 35 | module_param(debug, int, 0644); |
37 | MODULE_PARM_DESC(debug, "set debugging level (1=info,ts=2,ctrl=4,i2c=8,v8mem=16 (or-able))." DEBSTATUS); | 36 | MODULE_PARM_DESC(debug, "set debugging level (1=info,ts=2," |
37 | "ctrl=4,i2c=8,v8mem=16 (or-able))." DEBSTATUS); | ||
38 | #undef DEBSTATUS | 38 | #undef DEBSTATUS |
39 | 39 | ||
40 | #define deb_info(args...) dprintk(0x01,args) | 40 | #define deb_info(args...) dprintk(0x01, args) |
41 | #define deb_ts(args...) dprintk(0x02,args) | 41 | #define deb_ts(args...) dprintk(0x02, args) |
42 | #define deb_ctrl(args...) dprintk(0x04,args) | 42 | #define deb_ctrl(args...) dprintk(0x04, args) |
43 | #define deb_i2c(args...) dprintk(0x08,args) | 43 | #define deb_i2c(args...) dprintk(0x08, args) |
44 | #define deb_v8(args...) dprintk(0x10,args) | 44 | #define deb_v8(args...) dprintk(0x10, args) |
45 | 45 | ||
46 | /* JLP 111700: we will include the 1 bit gap between the upper and lower 3 bits | 46 | /* JLP 111700: we will include the 1 bit gap between the upper and lower 3 bits |
47 | * in the IBI address, to make the V8 code simpler. | 47 | * in the IBI address, to make the V8 code simpler. |
48 | * PCI ADDRESS FORMAT: 0x71C -> 0000 0111 0001 1100 (these are the six bits used) | 48 | * PCI ADDRESS FORMAT: 0x71C -> 0000 0111 0001 1100 (the six bits used) |
49 | * in general: 0000 0HHH 000L LL00 | 49 | * in general: 0000 0HHH 000L LL00 |
50 | * IBI ADDRESS FORMAT: RHHH BLLL | 50 | * IBI ADDRESS FORMAT: RHHH BLLL |
51 | * | 51 | * |
52 | * where R is the read(1)/write(0) bit, B is the busy bit | 52 | * where R is the read(1)/write(0) bit, B is the busy bit |
53 | * and HHH and LLL are the two sets of three bits from the PCI address. | 53 | * and HHH and LLL are the two sets of three bits from the PCI address. |
54 | */ | 54 | */ |
55 | #define B2C2_FLEX_PCIOFFSET_TO_INTERNALADDR(usPCI) (u8) (((usPCI >> 2) & 0x07) + ((usPCI >> 4) & 0x70)) | 55 | #define B2C2_FLEX_PCIOFFSET_TO_INTERNALADDR(usPCI) (u8) \ |
56 | #define B2C2_FLEX_INTERNALADDR_TO_PCIOFFSET(ucAddr) (u16) (((ucAddr & 0x07) << 2) + ((ucAddr & 0x70) << 4)) | 56 | (((usPCI >> 2) & 0x07) + ((usPCI >> 4) & 0x70)) |
57 | #define B2C2_FLEX_INTERNALADDR_TO_PCIOFFSET(ucAddr) (u16) \ | ||
58 | (((ucAddr & 0x07) << 2) + ((ucAddr & 0x70) << 4)) | ||
57 | 59 | ||
58 | /* | 60 | /* |
59 | * DKT 020228 | 61 | * DKT 020228 |
@@ -69,12 +71,13 @@ static int flexcop_usb_readwrite_dw(struct flexcop_device *fc, u16 wRegOffsPCI, | |||
69 | struct flexcop_usb *fc_usb = fc->bus_specific; | 71 | struct flexcop_usb *fc_usb = fc->bus_specific; |
70 | u8 request = read ? B2C2_USB_READ_REG : B2C2_USB_WRITE_REG; | 72 | u8 request = read ? B2C2_USB_READ_REG : B2C2_USB_WRITE_REG; |
71 | u8 request_type = (read ? USB_DIR_IN : USB_DIR_OUT) | USB_TYPE_VENDOR; | 73 | u8 request_type = (read ? USB_DIR_IN : USB_DIR_OUT) | USB_TYPE_VENDOR; |
72 | u8 wAddress = B2C2_FLEX_PCIOFFSET_TO_INTERNALADDR(wRegOffsPCI) | (read ? 0x80 : 0); | 74 | u8 wAddress = B2C2_FLEX_PCIOFFSET_TO_INTERNALADDR(wRegOffsPCI) | |
75 | (read ? 0x80 : 0); | ||
73 | 76 | ||
74 | int len = usb_control_msg(fc_usb->udev, | 77 | int len = usb_control_msg(fc_usb->udev, |
75 | read ? B2C2_USB_CTRL_PIPE_IN : B2C2_USB_CTRL_PIPE_OUT, | 78 | read ? B2C2_USB_CTRL_PIPE_IN : B2C2_USB_CTRL_PIPE_OUT, |
76 | request, | 79 | request, |
77 | request_type, /* 0xc0 read or 0x40 write*/ | 80 | request_type, /* 0xc0 read or 0x40 write */ |
78 | wAddress, | 81 | wAddress, |
79 | 0, | 82 | 0, |
80 | val, | 83 | val, |
@@ -82,55 +85,49 @@ static int flexcop_usb_readwrite_dw(struct flexcop_device *fc, u16 wRegOffsPCI, | |||
82 | B2C2_WAIT_FOR_OPERATION_RDW * HZ); | 85 | B2C2_WAIT_FOR_OPERATION_RDW * HZ); |
83 | 86 | ||
84 | if (len != sizeof(u32)) { | 87 | if (len != sizeof(u32)) { |
85 | err("error while %s dword from %d (%d).",read ? "reading" : "writing", | 88 | err("error while %s dword from %d (%d).", read ? "reading" : |
86 | wAddress,wRegOffsPCI); | 89 | "writing", wAddress, wRegOffsPCI); |
87 | return -EIO; | 90 | return -EIO; |
88 | } | 91 | } |
89 | return 0; | 92 | return 0; |
90 | } | 93 | } |
91 | |||
92 | /* | 94 | /* |
93 | * DKT 010817 - add support for V8 memory read/write and flash update | 95 | * DKT 010817 - add support for V8 memory read/write and flash update |
94 | */ | 96 | */ |
95 | static int flexcop_usb_v8_memory_req(struct flexcop_usb *fc_usb, | 97 | static int flexcop_usb_v8_memory_req(struct flexcop_usb *fc_usb, |
96 | flexcop_usb_request_t req, u8 page, u16 wAddress, | 98 | flexcop_usb_request_t req, u8 page, u16 wAddress, |
97 | u8 *pbBuffer,u32 buflen) | 99 | u8 *pbBuffer, u32 buflen) |
98 | { | 100 | { |
99 | // u8 dwRequestType; | ||
100 | u8 request_type = USB_TYPE_VENDOR; | 101 | u8 request_type = USB_TYPE_VENDOR; |
101 | u16 wIndex; | 102 | u16 wIndex; |
102 | int nWaitTime,pipe,len; | 103 | int nWaitTime, pipe, len; |
103 | |||
104 | wIndex = page << 8; | 104 | wIndex = page << 8; |
105 | 105 | ||
106 | switch (req) { | 106 | switch (req) { |
107 | case B2C2_USB_READ_V8_MEM: | 107 | case B2C2_USB_READ_V8_MEM: |
108 | nWaitTime = B2C2_WAIT_FOR_OPERATION_V8READ; | 108 | nWaitTime = B2C2_WAIT_FOR_OPERATION_V8READ; |
109 | request_type |= USB_DIR_IN; | 109 | request_type |= USB_DIR_IN; |
110 | // dwRequestType = (u8) RTYPE_READ_V8_MEMORY; | 110 | pipe = B2C2_USB_CTRL_PIPE_IN; |
111 | pipe = B2C2_USB_CTRL_PIPE_IN; | ||
112 | break; | 111 | break; |
113 | case B2C2_USB_WRITE_V8_MEM: | 112 | case B2C2_USB_WRITE_V8_MEM: |
114 | wIndex |= pbBuffer[0]; | 113 | wIndex |= pbBuffer[0]; |
115 | request_type |= USB_DIR_OUT; | 114 | request_type |= USB_DIR_OUT; |
116 | nWaitTime = B2C2_WAIT_FOR_OPERATION_V8WRITE; | 115 | nWaitTime = B2C2_WAIT_FOR_OPERATION_V8WRITE; |
117 | // dwRequestType = (u8) RTYPE_WRITE_V8_MEMORY; | 116 | pipe = B2C2_USB_CTRL_PIPE_OUT; |
118 | pipe = B2C2_USB_CTRL_PIPE_OUT; | ||
119 | break; | 117 | break; |
120 | case B2C2_USB_FLASH_BLOCK: | 118 | case B2C2_USB_FLASH_BLOCK: |
121 | request_type |= USB_DIR_OUT; | 119 | request_type |= USB_DIR_OUT; |
122 | nWaitTime = B2C2_WAIT_FOR_OPERATION_V8FLASH; | 120 | nWaitTime = B2C2_WAIT_FOR_OPERATION_V8FLASH; |
123 | // dwRequestType = (u8) RTYPE_WRITE_V8_FLASH; | 121 | pipe = B2C2_USB_CTRL_PIPE_OUT; |
124 | pipe = B2C2_USB_CTRL_PIPE_OUT; | ||
125 | break; | 122 | break; |
126 | default: | 123 | default: |
127 | deb_info("unsupported request for v8_mem_req %x.\n",req); | 124 | deb_info("unsupported request for v8_mem_req %x.\n", req); |
128 | return -EINVAL; | 125 | return -EINVAL; |
129 | } | 126 | } |
130 | deb_v8("v8mem: %02x %02x %04x %04x, len: %d\n",request_type,req, | 127 | deb_v8("v8mem: %02x %02x %04x %04x, len: %d\n", request_type, req, |
131 | wAddress,wIndex,buflen); | 128 | wAddress, wIndex, buflen); |
132 | 129 | ||
133 | len = usb_control_msg(fc_usb->udev,pipe, | 130 | len = usb_control_msg(fc_usb->udev, pipe, |
134 | req, | 131 | req, |
135 | request_type, | 132 | request_type, |
136 | wAddress, | 133 | wAddress, |
@@ -139,39 +136,53 @@ static int flexcop_usb_v8_memory_req(struct flexcop_usb *fc_usb, | |||
139 | buflen, | 136 | buflen, |
140 | nWaitTime * HZ); | 137 | nWaitTime * HZ); |
141 | 138 | ||
142 | debug_dump(pbBuffer,len,deb_v8); | 139 | debug_dump(pbBuffer, len, deb_v8); |
143 | |||
144 | return len == buflen ? 0 : -EIO; | 140 | return len == buflen ? 0 : -EIO; |
145 | } | 141 | } |
146 | 142 | ||
147 | #define bytes_left_to_read_on_page(paddr,buflen) \ | 143 | #define bytes_left_to_read_on_page(paddr,buflen) \ |
148 | ((V8_MEMORY_PAGE_SIZE - (paddr & V8_MEMORY_PAGE_MASK)) > buflen \ | 144 | ((V8_MEMORY_PAGE_SIZE - (paddr & V8_MEMORY_PAGE_MASK)) > buflen \ |
149 | ? buflen : (V8_MEMORY_PAGE_SIZE - (paddr & V8_MEMORY_PAGE_MASK))) | 145 | ? buflen : (V8_MEMORY_PAGE_SIZE - (paddr & V8_MEMORY_PAGE_MASK))) |
150 | 146 | ||
151 | static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb,flexcop_usb_request_t req, | 147 | static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb, |
152 | flexcop_usb_mem_page_t page_start, u32 addr, int extended, u8 *buf, u32 len) | 148 | flexcop_usb_request_t req, flexcop_usb_mem_page_t page_start, |
149 | u32 addr, int extended, u8 *buf, u32 len) | ||
153 | { | 150 | { |
154 | int i,ret = 0; | 151 | int i,ret = 0; |
155 | u16 wMax; | 152 | u16 wMax; |
156 | u32 pagechunk = 0; | 153 | u32 pagechunk = 0; |
157 | 154 | ||
158 | switch(req) { | 155 | switch(req) { |
159 | case B2C2_USB_READ_V8_MEM: wMax = USB_MEM_READ_MAX; break; | 156 | case B2C2_USB_READ_V8_MEM: |
160 | case B2C2_USB_WRITE_V8_MEM: wMax = USB_MEM_WRITE_MAX; break; | 157 | wMax = USB_MEM_READ_MAX; |
161 | case B2C2_USB_FLASH_BLOCK: wMax = USB_FLASH_MAX; break; | 158 | break; |
162 | default: | 159 | case B2C2_USB_WRITE_V8_MEM: |
163 | return -EINVAL; | 160 | wMax = USB_MEM_WRITE_MAX; |
161 | break; | ||
162 | case B2C2_USB_FLASH_BLOCK: | ||
163 | wMax = USB_FLASH_MAX; | ||
164 | break; | ||
165 | default: | ||
166 | return -EINVAL; | ||
164 | break; | 167 | break; |
165 | } | 168 | } |
166 | for (i = 0; i < len;) { | 169 | for (i = 0; i < len;) { |
167 | pagechunk = wMax < bytes_left_to_read_on_page(addr,len) ? wMax : bytes_left_to_read_on_page(addr,len); | 170 | pagechunk = |
168 | deb_info("%x\n",(addr & V8_MEMORY_PAGE_MASK) | (V8_MEMORY_EXTENDED*extended)); | 171 | wMax < bytes_left_to_read_on_page(addr, len) ? |
169 | if ((ret = flexcop_usb_v8_memory_req(fc_usb,req, | 172 | wMax : |
170 | page_start + (addr / V8_MEMORY_PAGE_SIZE), /* actual page */ | 173 | bytes_left_to_read_on_page(addr, len); |
171 | (addr & V8_MEMORY_PAGE_MASK) | (V8_MEMORY_EXTENDED*extended), | 174 | deb_info("%x\n", |
172 | &buf[i],pagechunk)) < 0) | 175 | (addr & V8_MEMORY_PAGE_MASK) | |
176 | (V8_MEMORY_EXTENDED*extended)); | ||
177 | |||
178 | ret = flexcop_usb_v8_memory_req(fc_usb, req, | ||
179 | page_start + (addr / V8_MEMORY_PAGE_SIZE), | ||
180 | (addr & V8_MEMORY_PAGE_MASK) | | ||
181 | (V8_MEMORY_EXTENDED*extended), | ||
182 | &buf[i], pagechunk); | ||
183 | |||
184 | if (ret < 0) | ||
173 | return ret; | 185 | return ret; |
174 | |||
175 | addr += pagechunk; | 186 | addr += pagechunk; |
176 | len -= pagechunk; | 187 | len -= pagechunk; |
177 | } | 188 | } |
@@ -180,8 +191,9 @@ static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb,flexcop_usb_request | |||
180 | 191 | ||
181 | static int flexcop_usb_get_mac_addr(struct flexcop_device *fc, int extended) | 192 | static int flexcop_usb_get_mac_addr(struct flexcop_device *fc, int extended) |
182 | { | 193 | { |
183 | return flexcop_usb_memory_req(fc->bus_specific,B2C2_USB_READ_V8_MEM, | 194 | return flexcop_usb_memory_req(fc->bus_specific, B2C2_USB_READ_V8_MEM, |
184 | V8_MEMORY_PAGE_FLASH,0x1f010,1,fc->dvb_adapter.proposed_mac,6); | 195 | V8_MEMORY_PAGE_FLASH, 0x1f010, 1, |
196 | fc->dvb_adapter.proposed_mac, 6); | ||
185 | } | 197 | } |
186 | 198 | ||
187 | #if 0 | 199 | #if 0 |
@@ -191,11 +203,8 @@ static int flexcop_usb_utility_req(struct flexcop_usb *fc_usb, int set, | |||
191 | { | 203 | { |
192 | u16 wValue; | 204 | u16 wValue; |
193 | u8 request_type = (set ? USB_DIR_OUT : USB_DIR_IN) | USB_TYPE_VENDOR; | 205 | u8 request_type = (set ? USB_DIR_OUT : USB_DIR_IN) | USB_TYPE_VENDOR; |
194 | // u8 dwRequestType = (u8) RTYPE_GENERIC, | ||
195 | int nWaitTime = 2, | 206 | int nWaitTime = 2, |
196 | pipe = set ? B2C2_USB_CTRL_PIPE_OUT : B2C2_USB_CTRL_PIPE_IN, | 207 | pipe = set ? B2C2_USB_CTRL_PIPE_OUT : B2C2_USB_CTRL_PIPE_IN, len; |
197 | len; | ||
198 | |||
199 | wValue = (func << 8) | extra; | 208 | wValue = (func << 8) | extra; |
200 | 209 | ||
201 | len = usb_control_msg(fc_usb->udev,pipe, | 210 | len = usb_control_msg(fc_usb->udev,pipe, |
@@ -218,36 +227,35 @@ static int flexcop_usb_i2c_req(struct flexcop_i2c_adapter *i2c, | |||
218 | struct flexcop_usb *fc_usb = i2c->fc->bus_specific; | 227 | struct flexcop_usb *fc_usb = i2c->fc->bus_specific; |
219 | u16 wValue, wIndex; | 228 | u16 wValue, wIndex; |
220 | int nWaitTime,pipe,len; | 229 | int nWaitTime,pipe,len; |
221 | // u8 dwRequestType; | ||
222 | u8 request_type = USB_TYPE_VENDOR; | 230 | u8 request_type = USB_TYPE_VENDOR; |
223 | 231 | ||
224 | switch (func) { | 232 | switch (func) { |
225 | case USB_FUNC_I2C_WRITE: | 233 | case USB_FUNC_I2C_WRITE: |
226 | case USB_FUNC_I2C_MULTIWRITE: | 234 | case USB_FUNC_I2C_MULTIWRITE: |
227 | case USB_FUNC_I2C_REPEATWRITE: | 235 | case USB_FUNC_I2C_REPEATWRITE: |
228 | /* DKT 020208 - add this to support special case of DiSEqC */ | 236 | /* DKT 020208 - add this to support special case of DiSEqC */ |
229 | case USB_FUNC_I2C_CHECKWRITE: | 237 | case USB_FUNC_I2C_CHECKWRITE: |
230 | pipe = B2C2_USB_CTRL_PIPE_OUT; | 238 | pipe = B2C2_USB_CTRL_PIPE_OUT; |
231 | nWaitTime = 2; | 239 | nWaitTime = 2; |
232 | // dwRequestType = (u8) RTYPE_GENERIC; | 240 | request_type |= USB_DIR_OUT; |
233 | request_type |= USB_DIR_OUT; | ||
234 | break; | 241 | break; |
235 | case USB_FUNC_I2C_READ: | 242 | case USB_FUNC_I2C_READ: |
236 | case USB_FUNC_I2C_REPEATREAD: | 243 | case USB_FUNC_I2C_REPEATREAD: |
237 | pipe = B2C2_USB_CTRL_PIPE_IN; | 244 | pipe = B2C2_USB_CTRL_PIPE_IN; |
238 | nWaitTime = 2; | 245 | nWaitTime = 2; |
239 | // dwRequestType = (u8) RTYPE_GENERIC; | 246 | request_type |= USB_DIR_IN; |
240 | request_type |= USB_DIR_IN; | ||
241 | break; | 247 | break; |
242 | default: | 248 | default: |
243 | deb_info("unsupported function for i2c_req %x\n",func); | 249 | deb_info("unsupported function for i2c_req %x\n", func); |
244 | return -EINVAL; | 250 | return -EINVAL; |
245 | } | 251 | } |
246 | wValue = (func << 8) | (i2c->port << 4); | 252 | wValue = (func << 8) | (i2c->port << 4); |
247 | wIndex = (chipaddr << 8 ) | addr; | 253 | wIndex = (chipaddr << 8 ) | addr; |
248 | 254 | ||
249 | deb_i2c("i2c %2d: %02x %02x %02x %02x %02x %02x\n",func,request_type,req, | 255 | deb_i2c("i2c %2d: %02x %02x %02x %02x %02x %02x\n", |
250 | wValue & 0xff, wValue >> 8, wIndex & 0xff, wIndex >> 8); | 256 | func, request_type, req, |
257 | wValue & 0xff, wValue >> 8, | ||
258 | wIndex & 0xff, wIndex >> 8); | ||
251 | 259 | ||
252 | len = usb_control_msg(fc_usb->udev,pipe, | 260 | len = usb_control_msg(fc_usb->udev,pipe, |
253 | req, | 261 | req, |
@@ -257,44 +265,49 @@ static int flexcop_usb_i2c_req(struct flexcop_i2c_adapter *i2c, | |||
257 | buf, | 265 | buf, |
258 | buflen, | 266 | buflen, |
259 | nWaitTime * HZ); | 267 | nWaitTime * HZ); |
260 | |||
261 | return len == buflen ? 0 : -EREMOTEIO; | 268 | return len == buflen ? 0 : -EREMOTEIO; |
262 | } | 269 | } |
263 | 270 | ||
264 | /* actual bus specific access functions, make sure prototype are/will be equal to pci */ | 271 | /* actual bus specific access functions, |
265 | static flexcop_ibi_value flexcop_usb_read_ibi_reg(struct flexcop_device *fc, flexcop_ibi_register reg) | 272 | make sure prototype are/will be equal to pci */ |
273 | static flexcop_ibi_value flexcop_usb_read_ibi_reg(struct flexcop_device *fc, | ||
274 | flexcop_ibi_register reg) | ||
266 | { | 275 | { |
267 | flexcop_ibi_value val; | 276 | flexcop_ibi_value val; |
268 | val.raw = 0; | 277 | val.raw = 0; |
269 | flexcop_usb_readwrite_dw(fc,reg, &val.raw, 1); | 278 | flexcop_usb_readwrite_dw(fc, reg, &val.raw, 1); |
270 | return val; | 279 | return val; |
271 | } | 280 | } |
272 | 281 | ||
273 | static int flexcop_usb_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_register reg, flexcop_ibi_value val) | 282 | static int flexcop_usb_write_ibi_reg(struct flexcop_device *fc, |
283 | flexcop_ibi_register reg, flexcop_ibi_value val) | ||
274 | { | 284 | { |
275 | return flexcop_usb_readwrite_dw(fc,reg, &val.raw, 0); | 285 | return flexcop_usb_readwrite_dw(fc, reg, &val.raw, 0); |
276 | } | 286 | } |
277 | 287 | ||
278 | static int flexcop_usb_i2c_request(struct flexcop_i2c_adapter *i2c, | 288 | static int flexcop_usb_i2c_request(struct flexcop_i2c_adapter *i2c, |
279 | flexcop_access_op_t op, u8 chipaddr, u8 addr, u8 *buf, u16 len) | 289 | flexcop_access_op_t op, u8 chipaddr, u8 addr, u8 *buf, u16 len) |
280 | { | 290 | { |
281 | if (op == FC_READ) | 291 | if (op == FC_READ) |
282 | return flexcop_usb_i2c_req(i2c, B2C2_USB_I2C_REQUEST, | 292 | return flexcop_usb_i2c_req(i2c, B2C2_USB_I2C_REQUEST, |
283 | USB_FUNC_I2C_READ, chipaddr, addr, buf, len); | 293 | USB_FUNC_I2C_READ, chipaddr, addr, buf, len); |
284 | else | 294 | else |
285 | return flexcop_usb_i2c_req(i2c, B2C2_USB_I2C_REQUEST, | 295 | return flexcop_usb_i2c_req(i2c, B2C2_USB_I2C_REQUEST, |
286 | USB_FUNC_I2C_WRITE, chipaddr, addr, buf, len); | 296 | USB_FUNC_I2C_WRITE, chipaddr, addr, buf, len); |
287 | } | 297 | } |
288 | 298 | ||
289 | static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb, u8 *buffer, int buffer_length) | 299 | static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb, |
300 | u8 *buffer, int buffer_length) | ||
290 | { | 301 | { |
291 | u8 *b; | 302 | u8 *b; |
292 | int l; | 303 | int l; |
293 | 304 | ||
294 | deb_ts("tmp_buffer_length=%d, buffer_length=%d\n", fc_usb->tmp_buffer_length, buffer_length); | 305 | deb_ts("tmp_buffer_length=%d, buffer_length=%d\n", |
306 | fc_usb->tmp_buffer_length, buffer_length); | ||
295 | 307 | ||
296 | if (fc_usb->tmp_buffer_length > 0) { | 308 | if (fc_usb->tmp_buffer_length > 0) { |
297 | memcpy(fc_usb->tmp_buffer+fc_usb->tmp_buffer_length, buffer, buffer_length); | 309 | memcpy(fc_usb->tmp_buffer+fc_usb->tmp_buffer_length, buffer, |
310 | buffer_length); | ||
298 | fc_usb->tmp_buffer_length += buffer_length; | 311 | fc_usb->tmp_buffer_length += buffer_length; |
299 | b = fc_usb->tmp_buffer; | 312 | b = fc_usb->tmp_buffer; |
300 | l = fc_usb->tmp_buffer_length; | 313 | l = fc_usb->tmp_buffer_length; |
@@ -304,23 +317,26 @@ static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb, u8 *buffer, in | |||
304 | } | 317 | } |
305 | 318 | ||
306 | while (l >= 190) { | 319 | while (l >= 190) { |
307 | if (*b == 0xff) | 320 | if (*b == 0xff) { |
308 | switch (*(b+1) & 0x03) { | 321 | switch (*(b+1) & 0x03) { |
309 | case 0x01: /* media packet */ | 322 | case 0x01: /* media packet */ |
310 | if ( *(b+2) == 0x47 ) | 323 | if (*(b+2) == 0x47) |
311 | flexcop_pass_dmx_packets(fc_usb->fc_dev, b+2, 1); | 324 | flexcop_pass_dmx_packets( |
312 | else | 325 | fc_usb->fc_dev, b+2, 1); |
313 | deb_ts("not ts packet %02x %02x %02x %02x \n", *(b+2), *(b+3), *(b+4), *(b+5) ); | 326 | else |
314 | 327 | deb_ts( | |
315 | b += 190; | 328 | "not ts packet %02x %02x %02x %02x \n", |
316 | l -= 190; | 329 | *(b+2), *(b+3), |
330 | *(b+4), *(b+5)); | ||
331 | b += 190; | ||
332 | l -= 190; | ||
317 | break; | 333 | break; |
318 | default: | 334 | default: |
319 | deb_ts("wrong packet type\n"); | 335 | deb_ts("wrong packet type\n"); |
320 | l = 0; | 336 | l = 0; |
321 | break; | 337 | break; |
322 | } | 338 | } |
323 | else { | 339 | } else { |
324 | deb_ts("wrong header\n"); | 340 | deb_ts("wrong header\n"); |
325 | l = 0; | 341 | l = 0; |
326 | } | 342 | } |
@@ -337,23 +353,26 @@ static void flexcop_usb_urb_complete(struct urb *urb) | |||
337 | int i; | 353 | int i; |
338 | 354 | ||
339 | if (urb->actual_length > 0) | 355 | if (urb->actual_length > 0) |
340 | deb_ts("urb completed, bufsize: %d actlen; %d\n",urb->transfer_buffer_length, urb->actual_length); | 356 | deb_ts("urb completed, bufsize: %d actlen; %d\n", |
357 | urb->transfer_buffer_length, urb->actual_length); | ||
341 | 358 | ||
342 | for (i = 0; i < urb->number_of_packets; i++) { | 359 | for (i = 0; i < urb->number_of_packets; i++) { |
343 | if (urb->iso_frame_desc[i].status < 0) { | 360 | if (urb->iso_frame_desc[i].status < 0) { |
344 | err("iso frame descriptor %d has an error: %d\n",i,urb->iso_frame_desc[i].status); | 361 | err("iso frame descriptor %d has an error: %d\n", i, |
362 | urb->iso_frame_desc[i].status); | ||
345 | } else | 363 | } else |
346 | if (urb->iso_frame_desc[i].actual_length > 0) { | 364 | if (urb->iso_frame_desc[i].actual_length > 0) { |
347 | deb_ts("passed %d bytes to the demux\n",urb->iso_frame_desc[i].actual_length); | 365 | deb_ts("passed %d bytes to the demux\n", |
366 | urb->iso_frame_desc[i].actual_length); | ||
348 | 367 | ||
349 | flexcop_usb_process_frame(fc_usb, | 368 | flexcop_usb_process_frame(fc_usb, |
350 | urb->transfer_buffer + urb->iso_frame_desc[i].offset, | 369 | urb->transfer_buffer + |
370 | urb->iso_frame_desc[i].offset, | ||
351 | urb->iso_frame_desc[i].actual_length); | 371 | urb->iso_frame_desc[i].actual_length); |
352 | } | 372 | } |
353 | urb->iso_frame_desc[i].status = 0; | 373 | urb->iso_frame_desc[i].status = 0; |
354 | urb->iso_frame_desc[i].actual_length = 0; | 374 | urb->iso_frame_desc[i].actual_length = 0; |
355 | } | 375 | } |
356 | |||
357 | usb_submit_urb(urb,GFP_ATOMIC); | 376 | usb_submit_urb(urb,GFP_ATOMIC); |
358 | } | 377 | } |
359 | 378 | ||
@@ -374,35 +393,47 @@ static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb) | |||
374 | } | 393 | } |
375 | 394 | ||
376 | if (fc_usb->iso_buffer != NULL) | 395 | if (fc_usb->iso_buffer != NULL) |
377 | pci_free_consistent(NULL,fc_usb->buffer_size, fc_usb->iso_buffer, fc_usb->dma_addr); | 396 | pci_free_consistent(NULL, |
397 | fc_usb->buffer_size, fc_usb->iso_buffer, | ||
398 | fc_usb->dma_addr); | ||
378 | } | 399 | } |
379 | 400 | ||
380 | static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb) | 401 | static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb) |
381 | { | 402 | { |
382 | u16 frame_size = le16_to_cpu(fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize); | 403 | u16 frame_size = le16_to_cpu( |
383 | int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO * frame_size,i,j,ret; | 404 | fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize); |
405 | int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO * | ||
406 | frame_size, i, j, ret; | ||
384 | int buffer_offset = 0; | 407 | int buffer_offset = 0; |
385 | 408 | ||
386 | deb_ts("creating %d iso-urbs with %d frames each of %d bytes size = %d.\n", | 409 | deb_ts("creating %d iso-urbs with %d frames " |
387 | B2C2_USB_NUM_ISO_URB, B2C2_USB_FRAMES_PER_ISO, frame_size,bufsize); | 410 | "each of %d bytes size = %d.\n", B2C2_USB_NUM_ISO_URB, |
411 | B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize); | ||
388 | 412 | ||
389 | fc_usb->iso_buffer = pci_alloc_consistent(NULL,bufsize,&fc_usb->dma_addr); | 413 | fc_usb->iso_buffer = pci_alloc_consistent(NULL, |
414 | bufsize, &fc_usb->dma_addr); | ||
390 | if (fc_usb->iso_buffer == NULL) | 415 | if (fc_usb->iso_buffer == NULL) |
391 | return -ENOMEM; | 416 | return -ENOMEM; |
417 | |||
392 | memset(fc_usb->iso_buffer, 0, bufsize); | 418 | memset(fc_usb->iso_buffer, 0, bufsize); |
393 | fc_usb->buffer_size = bufsize; | 419 | fc_usb->buffer_size = bufsize; |
394 | 420 | ||
395 | /* creating iso urbs */ | 421 | /* creating iso urbs */ |
396 | for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) | 422 | for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) { |
397 | if (!(fc_usb->iso_urb[i] = usb_alloc_urb(B2C2_USB_FRAMES_PER_ISO,GFP_ATOMIC))) { | 423 | fc_usb->iso_urb[i] = usb_alloc_urb(B2C2_USB_FRAMES_PER_ISO, |
424 | GFP_ATOMIC); | ||
425 | if (fc_usb->iso_urb[i] == NULL) { | ||
398 | ret = -ENOMEM; | 426 | ret = -ENOMEM; |
399 | goto urb_error; | 427 | goto urb_error; |
400 | } | 428 | } |
429 | } | ||
430 | |||
401 | /* initialising and submitting iso urbs */ | 431 | /* initialising and submitting iso urbs */ |
402 | for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) { | 432 | for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) { |
403 | int frame_offset = 0; | 433 | int frame_offset = 0; |
404 | struct urb *urb = fc_usb->iso_urb[i]; | 434 | struct urb *urb = fc_usb->iso_urb[i]; |
405 | deb_ts("initializing and submitting urb no. %d (buf_offset: %d).\n",i,buffer_offset); | 435 | deb_ts("initializing and submitting urb no. %d " |
436 | "(buf_offset: %d).\n", i, buffer_offset); | ||
406 | 437 | ||
407 | urb->dev = fc_usb->udev; | 438 | urb->dev = fc_usb->udev; |
408 | urb->context = fc_usb; | 439 | urb->context = fc_usb; |
@@ -416,26 +447,26 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb) | |||
416 | 447 | ||
417 | buffer_offset += frame_size * B2C2_USB_FRAMES_PER_ISO; | 448 | buffer_offset += frame_size * B2C2_USB_FRAMES_PER_ISO; |
418 | for (j = 0; j < B2C2_USB_FRAMES_PER_ISO; j++) { | 449 | for (j = 0; j < B2C2_USB_FRAMES_PER_ISO; j++) { |
419 | deb_ts("urb no: %d, frame: %d, frame_offset: %d\n",i,j,frame_offset); | 450 | deb_ts("urb no: %d, frame: %d, frame_offset: %d\n", |
451 | i, j, frame_offset); | ||
420 | urb->iso_frame_desc[j].offset = frame_offset; | 452 | urb->iso_frame_desc[j].offset = frame_offset; |
421 | urb->iso_frame_desc[j].length = frame_size; | 453 | urb->iso_frame_desc[j].length = frame_size; |
422 | frame_offset += frame_size; | 454 | frame_offset += frame_size; |
423 | } | 455 | } |
424 | 456 | ||
425 | if ((ret = usb_submit_urb(fc_usb->iso_urb[i],GFP_ATOMIC))) { | 457 | if ((ret = usb_submit_urb(fc_usb->iso_urb[i],GFP_ATOMIC))) { |
426 | err("submitting urb %d failed with %d.",i,ret); | 458 | err("submitting urb %d failed with %d.", i, ret); |
427 | goto urb_error; | 459 | goto urb_error; |
428 | } | 460 | } |
429 | deb_ts("submitted urb no. %d.\n",i); | 461 | deb_ts("submitted urb no. %d.\n",i); |
430 | } | 462 | } |
431 | 463 | ||
432 | /* SRAM */ | 464 | /* SRAM */ |
433 | 465 | flexcop_sram_set_dest(fc_usb->fc_dev, FC_SRAM_DEST_MEDIA | | |
434 | flexcop_sram_set_dest(fc_usb->fc_dev,FC_SRAM_DEST_MEDIA | FC_SRAM_DEST_NET | | 466 | FC_SRAM_DEST_NET | FC_SRAM_DEST_CAO | FC_SRAM_DEST_CAI, |
435 | FC_SRAM_DEST_CAO | FC_SRAM_DEST_CAI, FC_SRAM_DEST_TARGET_WAN_USB); | 467 | FC_SRAM_DEST_TARGET_WAN_USB); |
436 | flexcop_wan_set_speed(fc_usb->fc_dev,FC_WAN_SPEED_8MBITS); | 468 | flexcop_wan_set_speed(fc_usb->fc_dev, FC_WAN_SPEED_8MBITS); |
437 | flexcop_sram_ctrl(fc_usb->fc_dev,1,1,1); | 469 | flexcop_sram_ctrl(fc_usb->fc_dev, 1, 1, 1); |
438 | |||
439 | return 0; | 470 | return 0; |
440 | 471 | ||
441 | urb_error: | 472 | urb_error: |
@@ -448,20 +479,20 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb) | |||
448 | /* use the alternate setting with the larges buffer */ | 479 | /* use the alternate setting with the larges buffer */ |
449 | usb_set_interface(fc_usb->udev,0,1); | 480 | usb_set_interface(fc_usb->udev,0,1); |
450 | switch (fc_usb->udev->speed) { | 481 | switch (fc_usb->udev->speed) { |
451 | case USB_SPEED_LOW: | 482 | case USB_SPEED_LOW: |
452 | err("cannot handle USB speed because it is to sLOW."); | 483 | err("cannot handle USB speed because it is too slow."); |
453 | return -ENODEV; | 484 | return -ENODEV; |
454 | break; | 485 | break; |
455 | case USB_SPEED_FULL: | 486 | case USB_SPEED_FULL: |
456 | info("running at FULL speed."); | 487 | info("running at FULL speed."); |
457 | break; | 488 | break; |
458 | case USB_SPEED_HIGH: | 489 | case USB_SPEED_HIGH: |
459 | info("running at HIGH speed."); | 490 | info("running at HIGH speed."); |
460 | break; | 491 | break; |
461 | case USB_SPEED_UNKNOWN: /* fall through */ | 492 | case USB_SPEED_UNKNOWN: /* fall through */ |
462 | default: | 493 | default: |
463 | err("cannot handle USB speed because it is unkown."); | 494 | err("cannot handle USB speed because it is unknown."); |
464 | return -ENODEV; | 495 | return -ENODEV; |
465 | } | 496 | } |
466 | usb_set_intfdata(fc_usb->uintf, fc_usb); | 497 | usb_set_intfdata(fc_usb->uintf, fc_usb); |
467 | return 0; | 498 | return 0; |
@@ -485,7 +516,7 @@ static int flexcop_usb_probe(struct usb_interface *intf, | |||
485 | return -ENOMEM; | 516 | return -ENOMEM; |
486 | } | 517 | } |
487 | 518 | ||
488 | /* general flexcop init */ | 519 | /* general flexcop init */ |
489 | fc_usb = fc->bus_specific; | 520 | fc_usb = fc->bus_specific; |
490 | fc_usb->fc_dev = fc; | 521 | fc_usb->fc_dev = fc; |
491 | 522 | ||
@@ -502,21 +533,21 @@ static int flexcop_usb_probe(struct usb_interface *intf, | |||
502 | fc->dev = &udev->dev; | 533 | fc->dev = &udev->dev; |
503 | fc->owner = THIS_MODULE; | 534 | fc->owner = THIS_MODULE; |
504 | 535 | ||
505 | /* bus specific part */ | 536 | /* bus specific part */ |
506 | fc_usb->udev = udev; | 537 | fc_usb->udev = udev; |
507 | fc_usb->uintf = intf; | 538 | fc_usb->uintf = intf; |
508 | if ((ret = flexcop_usb_init(fc_usb)) != 0) | 539 | if ((ret = flexcop_usb_init(fc_usb)) != 0) |
509 | goto err_kfree; | 540 | goto err_kfree; |
510 | 541 | ||
511 | /* init flexcop */ | 542 | /* init flexcop */ |
512 | if ((ret = flexcop_device_initialize(fc)) != 0) | 543 | if ((ret = flexcop_device_initialize(fc)) != 0) |
513 | goto err_usb_exit; | 544 | goto err_usb_exit; |
514 | 545 | ||
515 | /* xfer init */ | 546 | /* xfer init */ |
516 | if ((ret = flexcop_usb_transfer_init(fc_usb)) != 0) | 547 | if ((ret = flexcop_usb_transfer_init(fc_usb)) != 0) |
517 | goto err_fc_exit; | 548 | goto err_fc_exit; |
518 | 549 | ||
519 | info("%s successfully initialized and connected.",DRIVER_NAME); | 550 | info("%s successfully initialized and connected.", DRIVER_NAME); |
520 | return 0; | 551 | return 0; |
521 | 552 | ||
522 | err_fc_exit: | 553 | err_fc_exit: |
@@ -535,12 +566,12 @@ static void flexcop_usb_disconnect(struct usb_interface *intf) | |||
535 | flexcop_device_exit(fc_usb->fc_dev); | 566 | flexcop_device_exit(fc_usb->fc_dev); |
536 | flexcop_usb_exit(fc_usb); | 567 | flexcop_usb_exit(fc_usb); |
537 | flexcop_device_kfree(fc_usb->fc_dev); | 568 | flexcop_device_kfree(fc_usb->fc_dev); |
538 | info("%s successfully deinitialized and disconnected.",DRIVER_NAME); | 569 | info("%s successfully deinitialized and disconnected.", DRIVER_NAME); |
539 | } | 570 | } |
540 | 571 | ||
541 | static struct usb_device_id flexcop_usb_table [] = { | 572 | static struct usb_device_id flexcop_usb_table [] = { |
542 | { USB_DEVICE(0x0af7, 0x0101) }, | 573 | { USB_DEVICE(0x0af7, 0x0101) }, |
543 | { } | 574 | { } |
544 | }; | 575 | }; |
545 | MODULE_DEVICE_TABLE (usb, flexcop_usb_table); | 576 | MODULE_DEVICE_TABLE (usb, flexcop_usb_table); |
546 | 577 | ||
@@ -557,10 +588,9 @@ static int __init flexcop_usb_module_init(void) | |||
557 | { | 588 | { |
558 | int result; | 589 | int result; |
559 | if ((result = usb_register(&flexcop_usb_driver))) { | 590 | if ((result = usb_register(&flexcop_usb_driver))) { |
560 | err("usb_register failed. (%d)",result); | 591 | err("usb_register failed. (%d)", result); |
561 | return result; | 592 | return result; |
562 | } | 593 | } |
563 | |||
564 | return 0; | 594 | return 0; |
565 | } | 595 | } |
566 | 596 | ||