亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sbpcd.c.txt

?? Linux塊設備驅動分析與模擬實現(xiàn)
?? TXT
?? 第 1 頁 / 共 5 頁
字號:
  1 /*
  2  *  sbpcd.c   CD-ROM device driver for the whole family of IDE-style
  3  *            Kotobuki/Matsushita/Panasonic CR-5xx drives for
  4  *            SoundBlaster ("Pro" or "16 ASP" or compatible) cards
  5  *            and for "no-sound" interfaces like Lasermate and the
  6  *            Panasonic CI-101P.
  7  *
  8  *  NOTE:     This is release 1.3.
  9  *            It works with my SbPro & drive CR-521 V2.11 from 2/92
 10  *            and with the new CR-562-B V0.75 on a "naked" Panasonic
 11  *            CI-101P interface. And vice versa. 
 12  *  
 13  *
 14  *  VERSION HISTORY
 15  *
 16  *  0.1  initial release, April/May 93, after mcd.c (Martin Harriss)
 17  *
 18  *  0.2  the "repeat:"-loop in do_sbpcd_request did not check for
 19  *       end-of-request_queue (resulting in kernel panic).
 20  *       Flow control seems stable, but throughput is not better.  
 21  *
 22  *  0.3  interrupt locking totally eliminated (maybe "inb" and "outb"
 23  *       are still locking) - 0.2 made keyboard-type-ahead losses.
 24  *       check_sbpcd_media_change added (to use by isofs/inode.c)
 25  *       - but it detects almost nothing.
 26  *
 27  *  0.4  use MAJOR 25 definitely.
 28  *       Almost total re-design to support double-speed drives and
 29  *       "naked" (no sound) interface cards.
 30  *       Flow control should be exact now (tell me if not).
 31  *       Don't occupy the SbPro IRQ line (not needed either); will
 32  *       live together with Hannu Savolainen's sndkit now.
 33  *       Speeded up data transfer to 150 kB/sec, with help from Kai
 34  *       Makisara, the "provider" of the "mt" tape utility.
 35  *       Give "SpinUp" command if necessary.
 36  *       First steps to support up to 4 drives (but currently only one).
 37  *       Implemented audio capabilities - workman should work, xcdplayer
 38  *       gives some problems.
 39  *       This version is still consuming too much CPU time, and
 40  *       sleeping still has to be worked on.
 41  *       During "long" implied seeks, it seems possible that a 
 42  *       ReadStatus command gets ignored. That gives the message
 43  *       "ResponseStatus timed out" (happens about 6 times here during
 44  *       a "ls -alR" of the YGGDRASIL LGX-Beta CD). Such a case is
 45  *       handled without data error, but it should get done better.
 46  *
 47  *  0.5  Free CPU during waits (again with help from Kai Makisara).
 48  *       Made it work together with the LILO/kernel setup standard.
 49  *       Included auto-probing code, as suggested by YGGDRASIL.
 50  *       Formal redesign to add DDI debugging.
 51  *       There are still flaws in IOCTL (workman with double speed drive).
 52  *
 53  *  1.0  Added support for all drive ids (0...3, no longer only 0)
 54  *       and up to 4 drives on one controller.
 55  *       Added "#define MANY_SESSION" for "old" multi session CDs.
 56  *
 57  *  1.1  Do SpinUp for new drives, too.
 58  *       Revised for clean compile under "old" kernels (pl9).
 59  *
 60  *  1.2  Found the "workman with double-speed drive" bug: use the driver's
 61  *       audio_state, not what the drive is reporting with ReadSubQ.
 62  *
 63  *  1.3  Minor cleanups.
 64  *       Refinements regarding Workman.
 65  *
 66  *     special thanks to Kai Makisara (kai.makisara@vtt.fi) for his fine
 67  *     elaborated speed-up experiments (and the fabulous results!), for
 68  *     the "push" towards load-free wait loops, and for the extensive mail
 69  *     thread which brought additional hints and bug fixes.
 70  * 
 71  *
 72  *   Copyright (C) 1993, 1994  Eberhard Moenkeberg <emoenke@gwdg.de>
 73  *                         or <eberhard_moenkeberg@rollo.central.de>
 74  *
 75  *                  The FTP-home of this driver is 
 76  *                  ftp.gwdg.de:/pub/linux/cdrom/drivers/sbpcd/.
 77  *
 78  *                  If you change this software, you should mail a .diff
 79  *                  file with some description lines to emoenke@gwdg.de.
 80  *                  I want to know about it.
 81  *
 82  *                  If you are the editor of a Linux CD, you should
 83  *                  enable sbpcd.c within your boot floppy kernel and
 84  *                  send me one of your CDs for free.
 85  *
 86  *   This program is free software; you can redistribute it and/or modify
 87  *   it under the terms of the GNU General Public License as published by
 88  *   the Free Software Foundation; either version 2, or (at your option)
 89  *   any later version.
 90  *
 91  *   You should have received a copy of the GNU General Public License
 92  *   (for example /usr/src/linux/COPYING); if not, write to the Free
 93  *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 94  *
 95  */
 96 
 97 #include <linux/config.h>
 98 #include <linux/errno.h>
 99 
100 #include <linux/sched.h>
101 #include <linux/timer.h>
102 #include <linux/fs.h>
103 #include <linux/kernel.h>
104 #include <linux/cdrom.h>
105 #include <linux/ioport.h>
106 #include <linux/sbpcd.h>
107 
108 #if SBPCD_USE_IRQ
109 #include <linux/signal.h>
110 #endif SBPCD_USE_IRQ
111 
112 #include <linux/ddi.h>
113 #include <linux/major.h> 
114 
115 #include <asm/system.h>
116 #include <asm/io.h>
117 #include <asm/segment.h>
118 #include <stdarg.h>
119 
120 #define MAJOR_NR MATSUSHITA_CDROM_MAJOR
121 #include "blk.h"
122 
123 #define VERSION "1.3 Eberhard Moenkeberg <emoenke@gwdg.de>"
124 
125 #define SBPCD_DEBUG
126 
127 #ifndef CONFIG_ISO9660_FS
128 #error "SBPCD: \"make config\" again. File system iso9660 is necessary."
129 #endif
130 
131 /*
132  * still testing around...
133  */
134 #define MANY_SESSION 0
135 #define CDMKE
136 #undef  FUTURE
137 #define WORKMAN 1 /* some testing stuff to make it better */
138 
139 /*==========================================================================*/
140 /*==========================================================================*/
141 /*
142  * auto-probing address list
143  * inspired by Adam J. Richter from Yggdrasil
144  *
145  * still not good enough - can cause a hang.
146  *   example: a NE 2000 ethernet card at 300 will cause a hang probing 310.
147  * if that happens, reboot and use the LILO (kernel) command line.
148  * The possibly conflicting ethernet card addresses get NOT probed 
149  * by default - to minimize the hang possibilities. 
150  *
151  * The SB Pro addresses get "mirrored" at 0x6xx - to avoid a type error,
152  * the 0x2xx-addresses must get checked before 0x6xx.
153  *
154  * send mail to emoenke@gwdg.de if your interface card is not FULLY
155  * represented here.
156  */
157 static int autoprobe[] = 
158 {
159   CDROM_PORT, SBPRO, /* probe with user's setup first */
160   0x230, 1, /* Soundblaster Pro and 16 (default) */
161   0x300, 0, /* CI-101P (default), Galaxy (default), Reveal (one default) */
162   0x250, 1, /* OmniCD default, Soundblaster Pro and 16 */
163   0x260, 1, /* OmniCD */
164   0x320, 0, /* Lasermate, CI-101P, Galaxy, Reveal (other default) */
165   0x340, 0, /* Lasermate, CI-101P */
166   0x360, 0, /* Lasermate, CI-101P */
167   0x270, 1, /* Soundblaster 16 */
168   0x630, 0, /* "sound card #9" (default) */
169   0x650, 0, /* "sound card #9" */
170   0x670, 0, /* "sound card #9" */
171   0x690, 0, /* "sound card #9" */
172 #if 0
173 /* some "hazardous" locations (ethernet cards) */
174   0x330, 0, /* Lasermate, CI-101P */
175   0x350, 0, /* Lasermate, CI-101P */
176   0x370, 0, /* Lasermate, CI-101P */
177   0x290, 1, /* Soundblaster 16 */
178   0x310, 0, /* Lasermate, CI-101P */
179 #endif
180 };
181 
182 #define NUM_AUTOPROBE  (sizeof(autoprobe) / sizeof(int))
183 
184 
185 /*==========================================================================*/
186 /*
187  * the forward references:
188  */
189 static void sbp_read_cmd(void);
190 static int  sbp_data(void);
191 
192 /*==========================================================================*/
193 
194 /*
195  * pattern for printk selection:
196  *
197  * (1<<DBG_INF)  necessary information
198  * (1<<DBG_IRQ)  interrupt trace
199  * (1<<DBG_REA)  "read" status trace
200  * (1<<DBG_CHK)  "media check" trace
201  * (1<<DBG_TIM)  datarate timer test
202  * (1<<DBG_INI)  initialization trace
203  * (1<<DBG_TOC)  tell TocEntry values
204  * (1<<DBG_IOC)  ioctl trace
205  * (1<<DBG_STA)  "ResponseStatus" trace
206  * (1<<DBG_ERR)  "xx_ReadError" trace
207  * (1<<DBG_CMD)  "cmd_out" trace
208  * (1<<DBG_WRN)  give explanation before auto-probing
209  * (1<<DBG_MUL)  multi session code test
210  * (1<<DBG_ID)   "drive_id != 0" test code
211  * (1<<DBG_IOX)  some special information
212  * (1<<DBG_DID)  drive ID test
213  * (1<<DBG_RES)  drive reset info
214  * (1<<DBG_SPI)  SpinUp test info
215  * (1<<DBG_IOS)  ioctl trace: "subchannel"
216  * (1<<DBG_IO2)  ioctl trace: general
217  * (1<<DBG_000)  unnecessary information
218  */
219 #if 1
220 static int sbpcd_debug =  (1<<DBG_INF) | (1<<DBG_WRN);
221 #else
222 static int sbpcd_debug =  (1<<DBG_INF) |
223                           (1<<DBG_TOC) |
224                           (1<<DBG_IOC) |
225                           (1<<DBG_IOX);
226 #endif
227 static int sbpcd_ioaddr = CDROM_PORT;   /* default I/O base address */
228 static int sbpro_type = SBPRO;
229 static int CDo_command, CDo_reset;
230 static int CDo_sel_d_i, CDo_enable;
231 static int CDi_info, CDi_status, CDi_data;
232 static int MIXER_addr, MIXER_data;
233 static struct cdrom_msf msf;
234 static struct cdrom_ti ti;
235 static struct cdrom_tochdr tochdr;
236 static struct cdrom_tocentry tocentry;
237 static struct cdrom_subchnl SC;
238 static struct cdrom_volctrl volctrl;
239 char *str_sb = "SoundBlaster";
240 char *str_lm = "LaserMate";
241 char *type;
242 
243 /*==========================================================================*/
244 
245 #if FUTURE
246 static struct wait_queue *sbp_waitq = NULL;
247 #endif FUTURE
248 
249 /*==========================================================================*/
250 
251 #define SBP_BUFFER_FRAMES 4 /* driver's own read_ahead */
252 
253 /*==========================================================================*/
254 
255 static u_char drive_family[]="CR-5";
256 static u_char drive_vendor[]="MATSHITA";
257 
258 static u_int response_count=0;
259 static u_int flags_cmd_out;
260 static u_char cmd_type=0;
261 static u_char drvcmd[7];
262 static u_char infobuf[20];
263 
264 static u_char timed_out=0;
265 static u_int datarate= 1000000;
266 static u_int maxtim16=16000000;
267 static u_int maxtim04= 4000000;
268 static u_int maxtim02= 2000000;
269 static u_int maxtim_8=   30000;
270 #if MANY_SESSION
271 static u_int maxtim_data= 9000;
272 #else
273 static u_int maxtim_data= 3000;
274 #endif MANY_SESSION
275 
276 /*==========================================================================*/
277 
278 static int ndrives=0;
279 static u_char drv_pattern[4]={ 0x80, 0x80, 0x80, 0x80 }; /* auto speed */
280 /*  /X:... drv_pattern[0] |= (sax_n1|sax_n2);         */
281 /*  /A:... for (i=0;i<4;i++) drv_pattern[i] |= sax_a; */
282 /*  /N:... ndrives=i-'';                             */
283 
284 /*==========================================================================*/
285 /*
286  * drive space begins here (needed separate for each unit) 
287  */
288 static int d=0; /* DS index: drive number */
289 
290 static struct {
291   char drv_minor; /* minor number or -1 */
292 
293   char drive_model[4];
294   char firmware_version[4];
295   u_char *sbp_buf; /* Pointer to internal data buffer,
296                            space allocated during sbpcd_init() */
297   int sbp_first_frame;  /* First frame in buffer */
298   int sbp_last_frame;   /* Last frame in buffer  */
299   int sbp_read_frames;   /* Number of frames being read to buffer */
300   int sbp_current;       /* Frame being currently read */
301 
302   u_char drv_type;
303   u_char drv_options;
304   u_char status_byte;
305   u_char diskstate_flags;
306   u_char sense_byte;
307   
308   u_char CD_changed;
309   
310   u_char error_byte;
311   
312   u_char f_multisession;
313   u_int lba_multi;
314   
315   u_char audio_state;
316   u_int pos_audio_start;
317   u_int pos_audio_end;
318   char vol_chan0;
319   u_char vol_ctrl0;
320   char vol_chan1;
321   u_char vol_ctrl1;
322 #if 000
323   char vol_chan2;
324   u_char vol_ctrl2;
325   char vol_chan3;
326   u_char vol_ctrl3;
327 #endif 000
328   
329   u_char SubQ_audio;
330   u_char SubQ_ctl_adr;
331   u_char SubQ_trk;
332   u_char SubQ_pnt_idx;
333   u_int SubQ_run_tot;
334   u_int SubQ_run_trk;
335   u_char SubQ_whatisthis;
336   
337   u_char UPC_ctl_adr;
338   u_char UPC_buf[7];
339   
340   int CDsize_blk;
341   int frame_size;
342   int CDsize_frm;
343   
344   u_char xa_byte; /* 0x20: XA capabilities */
345   u_char n_first_track; /* binary */
346   u_char n_last_track; /* binary (not bcd), 0x01...0x63 */
347   u_int size_msf; /* time of whole CD, position of LeadOut track */
348   u_int size_blk;
349   
350   u_char TocEnt_nixbyte; /* em */
351   u_char TocEnt_ctl_adr;
352   u_char TocEnt_number;
353   u_char TocEnt_format; /* em */
354   u_int TocEnt_address;
355   u_char ored_ctl_adr; /* to detect if CDROM contains data tracks */
356   
357   struct {
358     u_char nixbyte; /* em */
359     u_char ctl_adr; /* 0x4x: data, 0x0x: audio */
360     u_char number;
361     u_char format; /* em */ /* 0x00: lba, 0x01: msf */
362     u_int address;
363   } TocBuffer[MAX_TRACKS+1]; /* last entry faked */ 
364   
365   int in_SpinUp;
366   
367 } DS[4];
368 
369 /*
370  * drive space ends here (needed separate for each unit)
371  */
372 
373 /*==========================================================================*/
374 /*==========================================================================*/
375 /*
376  * DDI interface definitions
377  */
378 #ifdef SBPCD_DEBUG
379 # define DPRINTF(x)     sbpcd_dprintf x
380 
381 void sbpcd_dprintf(int level, char *fmt, ...)
382 {
383   char buff[256];
384   va_list args;
385   extern int vsprintf(char *buf, const char *fmt, va_list args);
386 
387   if (! (sbpcd_debug & (1 << level))) return;
388 
389   va_start(args, fmt);
390   vsprintf(buff, fmt, args);
391   va_end(args);
392   printk(buff);
393 }
394 
395 #else
396 # define DPRINTF(x)     /* nothing */
397 
398 #endif SBPCD_DEBUG
399 
400 /*
401  * maintain trace bit pattern

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
性感美女久久精品| 成人美女视频在线观看18| 2021中文字幕一区亚洲| 色综合久久天天综合网| 成人av电影在线网| 成人av资源网站| 99这里只有久久精品视频| 亚洲国产成人av| 国产精品理伦片| 国产亚洲一区字幕| 国产日产欧产精品推荐色| 久久欧美一区二区| 国产视频一区在线播放| 久久精品视频免费观看| 欧美经典一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 日韩视频免费观看高清完整版 | 日韩一区二区三区电影在线观看| 欧美日韩国产在线播放网站| 91麻豆国产精品久久| 色呦呦日韩精品| 色婷婷综合五月| 欧美亚男人的天堂| 日韩欧美国产一区二区在线播放| 日韩一级二级三级| 国产人久久人人人人爽| 椎名由奈av一区二区三区| 亚洲国产精品精华液网站| 日本人妖一区二区| 精品一区二区三区日韩| 国产乱码精品一区二区三区av| 波多野结衣中文字幕一区| 欧美综合一区二区三区| 日韩美女一区二区三区| 国产精品免费av| 亚洲影院在线观看| 日韩精品亚洲一区二区三区免费| 国产一区二区三区日韩 | 国产乱码精品一区二区三区av| 高清不卡一区二区| 欧美日韩电影一区| 精品国产伦一区二区三区观看体验| 亚洲国产精品成人综合色在线婷婷| 一区二区三区日韩精品| 激情伊人五月天久久综合| 一本色道a无线码一区v| 日韩精品一区二区三区视频| 亚洲老司机在线| 天堂av在线一区| 成人动漫一区二区在线| 91精品久久久久久久久99蜜臂| 久久奇米777| 免费在线看一区| 91在线观看免费视频| 精品国产在天天线2019| 亚洲最大色网站| 成人aa视频在线观看| 6080午夜不卡| 亚洲精品乱码久久久久久日本蜜臀| 裸体一区二区三区| 欧美日韩一区精品| 亚洲欧美成aⅴ人在线观看| 美女视频黄 久久| 欧美三区在线视频| 中文字幕在线一区二区三区| 激情深爱一区二区| 51精品国自产在线| 性做久久久久久久免费看| 91网上在线视频| 国产精品久久二区二区| 成人性生交大合| 一区二区三区鲁丝不卡| 波多野结衣一区二区三区| 久久品道一品道久久精品| 久久av老司机精品网站导航| 欧美精品日韩综合在线| 天天综合天天综合色| 欧美亚洲另类激情小说| 一区二区日韩av| 欧洲人成人精品| 亚洲国产成人av| 国产美女精品一区二区三区| 国产精品久久久久久妇女6080| 蜜乳av一区二区三区| 91豆麻精品91久久久久久| 国产精品美女久久福利网站| 成人av免费网站| 亚洲激情校园春色| 91久久精品国产91性色tv| 伊人夜夜躁av伊人久久| 91高清在线观看| 五月天激情小说综合| 欧美一激情一区二区三区| 美女www一区二区| 久久亚洲一区二区三区四区| 国产精品自产自拍| 国产精品视频线看| 91国在线观看| 日韩黄色免费电影| 26uuu国产电影一区二区| 国产毛片一区二区| 亚洲视频综合在线| 欧美亚男人的天堂| 韩国在线一区二区| 综合激情成人伊人| 欧美女孩性生活视频| 国产一区二区三区国产| 亚洲视频 欧洲视频| 欧美在线观看一二区| 日韩高清在线观看| 国产欧美日韩激情| 欧美影院一区二区三区| 麻豆91在线播放| 亚洲黄色小视频| 精品人伦一区二区色婷婷| av在线播放一区二区三区| 天天爽夜夜爽夜夜爽精品视频| 久久久影视传媒| 欧美视频精品在线| 国产成人精品三级| 日韩成人一区二区三区在线观看| 亚洲一区二区三区自拍| 高清在线不卡av| 日本伊人精品一区二区三区观看方式| 欧美在线免费观看亚洲| 粉嫩高潮美女一区二区三区| 亚洲一区二区在线播放相泽 | 精品一区二区在线看| 亚洲人成伊人成综合网小说| 欧美成人精品高清在线播放| 色婷婷激情一区二区三区| 国内精品在线播放| 性做久久久久久久久| 亚洲柠檬福利资源导航| 久久久三级国产网站| 欧美麻豆精品久久久久久| 99re66热这里只有精品3直播| 韩日欧美一区二区三区| 男女性色大片免费观看一区二区| 亚洲综合图片区| 欧美一区午夜视频在线观看| 日本不卡视频在线| 亚洲猫色日本管| 日本一区二区三区四区| 欧美一区三区二区| 欧美日韩三级在线| 91麻豆福利精品推荐| 国产成人亚洲精品狼色在线| 理论电影国产精品| 免费在线看成人av| 日韩精品一区第一页| 亚洲高清免费视频| 亚洲一区在线视频观看| 1024成人网色www| 亚洲天堂久久久久久久| 中文字幕一区在线观看视频| 国产农村妇女毛片精品久久麻豆| 精品伦理精品一区| 久久久久久久网| 久久久久九九视频| 国产日韩欧美a| 国产精品午夜在线| 亚洲天堂av一区| 一区二区三区在线视频免费观看| 亚洲欧美乱综合| 亚洲国产视频网站| 午夜av一区二区三区| 蜜桃视频一区二区| 久久99精品国产麻豆婷婷| 激情小说欧美图片| 成人国产精品视频| 色就色 综合激情| 在线电影欧美成精品| 精品久久国产老人久久综合| 久久久久久免费网| 中文字幕一区二区在线观看| 亚洲乱码国产乱码精品精98午夜| 亚洲线精品一区二区三区| 日本欧美一区二区在线观看| 精品一区二区久久久| 成人av网址在线观看| 欧美亚一区二区| 久久一区二区三区国产精品| 最新中文字幕一区二区三区 | 91色|porny| 欧美精品视频www在线观看| 欧美白人最猛性xxxxx69交| 国产精品水嫩水嫩| 亚洲国产精品一区二区尤物区| 免费在线观看视频一区| 国产99精品视频| 欧美一a一片一级一片| 日韩三级伦理片妻子的秘密按摩| 国产视频一区不卡| 亚洲综合一区二区三区| 韩国毛片一区二区三区| 91美女片黄在线观看91美女| 日韩视频123| 日韩美女视频19| 久久99精品久久久久|