1. Fill up the pci_device_id table as follows.

static const struct pci_device_id pci_ids[] = {
{
.vendor = VENDOR_ID,
.device = DEVICE_ID,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.driver_data = (unsigned long) ~HOST_FORCE_PCI,
},

{   /* all zero 's */ },
};

2. This pci_device_id structure needs to be exported to user space to allow the hotplug
and module loading systems know what module works with what hardware devices.
The macro MODULE_DEVICE_TABLE accomplishes this.

An example is:
MODULE_DEVICE_TABLE(pci, pci_ids);

3. Fill the standard PCI_Driver structure with the PCI_id table,probe and remove functions.

say for example:

static struct pci_driver mypci_driver = {
.name       =  DRIVER_NAME,
.id_table    = pci_ids,
.probe       =  mypci_probe,
.remove     = __devexit_p(mypci_remove),
.suspend    = NULL,
.resume     = NULL,
};

 The main structure that all PCI drivers must create in order to be registered with the kernel properly is the struct pci_driver structure. This structure consists of a number of function callbacks and variables that describe the PCI driver to the PCI core.

4. Registering a PCI Driver:

**To register the struct pci_driver with the PCI core, a call to pci_register_driver (for network register_netdev,for char misc_register,for block drivers register_blkdev) is made with a pointer to the struct pci_driver.

**This is traditionally done in the module initialization code for the PCI driver:

static int pci_init(void)
{
PRINT(" \n\nPCI DRIVER IS LOADED IN KERNEL SPACE \n\n");
return pci_register_driver(&mypci_driver);
}

**Note that the pci_register_driver function either returns a negative error number
or 0 if everything was registered successfully.

5.Accessing PCI configuration space:

The configuration space can be accessed through 8-bit, 16-bit, or 32-bit data transfers at any time.
The relevant functions are prototyped in <linux/pci.h>:

int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val);
int pci_read_config_word(struct pci_dev *dev, int where, u16 *val);
int pci_read_config_dword(struct pci_dev *dev, int where, u32 *val);
int pci_write_config_byte(struct pci_dev *dev, int where, u8 val);
int pci_write_config_word(struct pci_dev *dev, int where, u16 val);
int pci_write_config_dword(struct pci_dev *dev, int where, u32 val);

6. Enabling the PCI Device:

**In the probe function for the PCI driver, before the driver can access any device resource
(I/O region or interrupt) of the PCI device, the driver must call the pci_enable_device
function:

**int pci_enable_device(struct pci_dev *dev);

**This function actually enables the device. It wakes up the device and in some cases also assigns its interrupt line and I/O regions.

struct pci_dev {
        struct list_head global_list;   /* node in list of all PCI devices */
        struct list_head bus_list;      /* node in per-bus list */
        struct pci_bus  *bus;           /* bus this device is on */
        struct pci_bus  *subordinate;   /* bus this device bridges to */

        void            *sysdata;       /* hook for sys-specific extension */
        struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */

        unsigned int    devfn;          /* encoded device & function index */
        unsigned short  vendor;
        unsigned short  device;
        unsigned short  subsystem_vendor;
        unsigned short  subsystem_device;
        unsigned int    class;          /* 3 bytes: (base,sub,prog-if) */
        u8              hdr_type;       /* PCI header type (`multi' flag masked out) */
        u8              rom_base_reg;   /* which config register controls the ROM */
        u8              pin;            /* which interrupt pin this device uses */

        struct pci_driver *driver;      /* which driver has allocated this device */
        u64             dma_mask;       /* Mask of the bits of bus address this
                                           device implements.  Normally this is
                                           0xffffffff.  You only need to change
                                           this if your device has broken DMA
                                           or supports 64-bit transfers.  */

        pci_power_t     current_state;  /* Current operating state. In ACPI-speak,
                                           this is D0-D3, D0 being fully functional,
                                           and D3 being off. */

        pci_channel_state_t error_state;        /* current connectivity state */
        struct  device  dev;            /* Generic device interface */

        /* device is compatible with these IDs */
        unsigned short vendor_compatible[DEVICE_COUNT_COMPATIBLE];
        unsigned short device_compatible[DEVICE_COUNT_COMPATIBLE];

        int             cfg_size;       /* Size of configuration space */

        /*
         * Instead of touching interrupt line and base address registers
         * directly, use the values stored here. They might be different!
         */
        unsigned int    irq;
        struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */

        /* These fields are used by common fixups */
        unsigned int    transparent:1;  /* Transparent PCI bridge */
        unsigned int    multifunction:1;/* Part of multi-function device */
        /* keep track of device state */
        unsigned int    is_enabled:1;   /* pci_enable_device has been called */
        unsigned int    is_busmaster:1; /* device is busmaster */
        unsigned int    no_msi:1;       /* device may not use msi */
        unsigned int    block_ucfg_access:1;    /* userspace config space access is blocked */

        u32             saved_config_space[16]; /* config space saved at suspend time */
        struct hlist_head saved_cap_space;
        struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
        int rom_attr_enabled;           /* has display of the rom attribute been enabled? */
        struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
};


7.Enabling the PCI-Bus mastering for the device by calling pci_set_master Kernel API.
  This API enables bus-mastering on the device and calls pcibios_set_master  to do the needed arch specific settings
  It is done in the driver,if it is needed.

**BusMastering:
bus mastering is the capability of devices on the PCI bus (other than the system chipset, of course) to
  take control of the bus and perform transfers directly.PCI's design allows bus mastering of multiple devices on the bus simultaneously,
  with the arbitration circuitry working to ensure that no device on the bus (including the processor!) locks out any other device.
  At the same time though, it allows any given device to use the full bus throughput if no other device needs to transfer anything.

**PCI transactions work in a master-slave relationship. A master is an agent that initiates a transaction (can be a read or a write).
While the host CPU is often the bus master, all PCI boards can potentially claim the bus and become a bus master.

**When a PCI device is enabled, it's bus mastering is also enabled.  This occurs before any driver code is
executed.

8. Accessing Memory Regions

**unsigned long pci_resource_start(struct pci_dev *dev, int bar);
The function returns the first address (memory address or I/O port number)
associated with one of the six PCI I/O regions. The region is selected by the integer
bar (the base address register), ranging from 0–5 (inclusive).

**unsigned long pci_resource_end(struct pci_dev *dev, int bar);
The function returns the last address that is part of the I/O region number bar.
Note that this is the last usable address, not the first address after the region.

**unsigned long pci_resource_flags(struct pci_dev *dev, int bar);
This function returns the flags associated with this resource.
All resource flags are defined in <linux/ioport.h>; the most important are:
IORESOURCE_IO
IORESOURCE_MEM ( if the resource type is memory resource, then we can access the register by means of readl/b/w/writel/b/w functions)

#define pci_resource_start(dev,bar)   ((dev)->resource[(bar)].start)
#define pci_resource_end(dev,bar)     ((dev)->resource[(bar)].end)
#define pci_resource_flags(dev,bar)   ((dev)->resource[(bar)].flags)
#define pci_resource_len(dev,bar) \
        ((pci_resource_start((dev),(bar)) == 0 &&       \
          pci_resource_end((dev),(bar)) ==              \
          pci_resource_start((dev),(bar))) ? 0 :        \
                                                        \
         (pci_resource_end((dev),(bar)) -               \
          pci_resource_start((dev),(bar)) + 1))

9.Reserving the PCI I/O and memory regions.

int pci_request_region (struct pci_dev * pdev, int bar, char * res_name);

Arguments:
pdev
    PCI device whose resources are to be reserved
bar
    BAR to be reserved
res_name
    Name to be associated with resource.

Description
Mark the PCI region associated with PCI device pdev BR bar as being reserved by owner res_name.
Do not access any address inside the PCI regions unless this call returns successfully.

10. Converting physical address to virtual address.

pci.pVirtualBaseAddr=(unsigned int *)ioremap_nocache(pci.PciBaseStart,pci.length);

11.

else
    KERNELDIR ?= /lib/modules/$(shell uname -r)/build
    PWD  := $(shell pwd)
default:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
Endif


static struct miscdevice miscdev= {
        /*
         * We don't care what minor number we end up with, so tell the
         * kernel to just pick one.
         */
        MISC_DYNAMIC_MINOR,
        /*
         * Name ourselves /dev/UniPro.
         */
        "miscdev",
        /*
         * What functions to call when a program performs file
         * operations on the device.
         */
        &fops
};

misc_register(&miscdev);

출처 : http://inbasudhakar.blogspot.com/2011/08/pci-driver-flow.html 
Posted by 삼성동고양이


손가락 꾸욱 한번 눌러주세요. 
큰 힘이 됩니다. ^ㅡ^



아이폰 번들로 버텨온 어언 거의 10개월 정도... 드디어 이어폰이 망가지고, 그동안 벼르고 벼르던 헤드폰을 구입하기로 마음을 먹었습니다. 어떤걸 살까... 고민을 많이 해서 몇몇 가지를 골라보던 도중 역시 저는 구세대인지 SONY 가 땡기더라구요. 고등학교때 큰맘먹구 샀던 666 이어폰과 만족했던 그 음질이 생각나기도 하고, 학교 랩실에서 들었던 소니 해드폰도 생각나서, 소니에서 구입을 하기로 하고 목록을 찾아보던 도중 SONY MDR-V700DJ가 보이더라구요. 

이 제품 자체는 최신 제품은 아닙니다. 네이버 지식 쇼핑 기준 등록일이 2003년인거 봐서는 출시한지는 약 8년 이상이 된거 같네요. 하지만 아직까지 많은 사람들에게 사랑받고 판매되고 있는 제품입니다. 간단한 Specification을 다음과 같습니다.


MDR-V150 Specs

Frequency Response: 5 Hz - 30 kHz
Magnet Type: Neodymium
Sensitivity: 107 dB/mW
Impedance: 24 ohms
Cable Length: 10 Feet
Power Handling Capacity: 3000 mW
Warranty: One Year
출처 : 아마존










사실 저는 이것이 완전 개봉기는 아니구요. 회사에서 받아서, 회사 일이 늦게끝나는 바람에 주말까지 사용하였고, 주말에 다시 동봉해서 이렇게 왔다는걸 보여주기 위해서... 반 개봉기???-0-;;; 암튼 위와 같이 왔습니다. 

구성품 : BOX, 포켓 주머니(파우치?), MDR-V700DJ, 설명서, 55케이블 컨버터(Audio Converter)

사실 받으면서도 찝찝한게 리퍼 상품인지 아닌지 보통 구매를 하는 사람이 판단하는 기준은 박스의 동봉 상태이잖아요. 하지만 박스 동봉상태는 완전 밀봉이던가 스티커 같은것이 없었구요, 그냥 Folding되어 있는 상태였습니다. 쓰다가 집어 넣어도 모를만큼..-_-;;; 근데 음질은 에이징이 거의 안되어있는거 봐서는 새거나 거의 새거...? 우선은 구입을 했으니, 믿고 써야죠...ㅋㅋㅋ







헤드폰 자체는 무계감이 조금 있는 편입니다. 하지만 저는 더 무거운 것을 바란만큼 그렇게 무겁다고 느껴지지는 않네요. 그냥 머리에 놓도 다닐만한 무계네요. 그리고 제 머리가 작지 않은 편인데도 착용감도 괜찮고요. 어떤 분께서는 너무 귀를 조인다고 하시는 분도 계시는데 저 같은경우에는 그렇게 나쁘지 않았어요. 제 머리가 큼에도 불구하고..-_-;;; 

그리고 접어서 같이 딸려온 파우치에 위와 같이 담아서 보관할 수 이쑤요. 파우치 재질 자체도 그리 싸구려 같은 느낌은 들지 않습니다. 꽤 괜찮아요.^^



MDR-V700DJ의 구매층을 보면은 저같이 음악을 듣기 위해 구입을 하는 사람도 있지만, 디제잉이나 기타 연습을 하는 분들이 구입을 하는 경우도 많더라구요. 그래서 기본적으로 55케이블(저는 이렇게 부릅니다만 맞는지는 모르겟네요 -_-;) 슬롯에 꽂을 수 있게끔 되어있꾸요, 이어폰 잭은 컨버터를 빼내면 저렇게 나옵니다. 다만 단점이 MP3 Player나 핸드폰에 꽂아놓으면 컨버터를 위한 나사가 보이는게 조금 아쉽기는 하더라구요^^;;;

 






위의 소니 마크의 저 간지... 저 디자인이 너무 이뻐서 구입한 것도 있네요^^; 상당히 디자인이 괜찮아요. 어떤 여자분들은 비니에 쓰면 딱이라면서 구입하는 분도 계시는데...(블로그에 음질이나 뭐 해드폰의 기능성에 대한 언급은 없고, 디자인에 대한 얘기만 나오더라구요-_-;;;) 암튼 그 포스트를 보면서 디자인은 나쁘지 않겠구나 하는 생각이 들더라구요.^^;;; 디자인은 나쁘지 않았습니다. 하지만 제가 사용하기에는 몇가지 단점이 있는데 그건 아래에 언급하겠습니다.




말씀드린듯이 마운트를 하면... 나사가 보이는게 조금...-_-;;; 아쉽더라구요. 또 위에 같이 아이폰 4와 같이 사용하면... 손으로 잡았을때 위로 기울어집니다. 기본 잭과 라인의 무계가 있어서... 너무 큰게 단점이고, 선이 좀 깁니다. 회사 출퇴근용으로 쓰기에는 좀 거추장 스러운 면도 있는데, 그냥 패션이라니 하고 그냥 늘어트리고 다닙니다.ㅋㅋㅋ 단정한것도 좋지만 그게 안되면 내스탈~루 다니는 것도 나쁘지 않죠~~~ㅋㅋㅋ



제가 구입한 가격은 약 12만원 정도 주고 샀어요. 최저가 홈페이지에서... 가격은 들일만 한 정도의 퀄리티가 있지 않나 싶습니다.

SONY MDR-V700DJ 장 단점 요약

장점
1. 탁월한 저음 표현력
2. 확실한 소리의 원근감  
3. 머리에 착 감기는 착용감
4. 나쁘지 않은 디자인
5. 넉넉한 선의 길이(기타 연습하시는 분이나 디제잉이나 컴퓨터에 연결해서 쓰시는 분들이게는 장점일듯)

단점
1. 그다지 포터블 하지 않음(선의 무계, 제품 자체 무계)
2. 선의 길이가 들고 다니기에는 너무 길음.헤드폰을 벗고 손으로 들으면, 가끔 줄이 질질 끌리는걸 모를 떄도 많음...)
3. 고음 표현력이 생각보다 그렇게 뛰어나지는 않음 



추천 한번 눌러주고 가세요~~~~~~~~~~큰 힘이 됩니다!!!^ㅡ^


09-23 추가 내용-----------------------------------------------------------
스피커가 덜그럭 거리는것 때문에 소니 코리아에 A/S를 보냈었습니다.
예상 소요 일자는 일주일 걸린다고 했는데. 보낸지 2일만에 새 제품으로 돌아왔네요.
소니 코리아의 A/S는 별로라고 들었는데 생각보다 깔끔한 처리가 마음에 들었습니다. ^^








Posted by 삼성동고양이





 




 고 전태일 열사 어머님이신 이소선 여사께서 고인이 되셨다고 하네요. 오늘 3일 오전 11시 45분 성루 도봉구의 한일병원에서 향년 81세로 별세를 하셨다고 하네요. 이 여사님은 7월 18일 창신동 자택에서 심장이 멈춘 채 가족들에게 발견되어서 병원으로 이송되었고, 입원 치료를 한일 병원에서 받았으나, 결국 소천하셨다고 하네요. 

참고로 아들인 고 전태일 열사는 1970년 22세의 나이에 분신 자결을 하였던 분이며, 노동환경의 열학함에 대하여 투쟁을 하였었죠. 이 이후 이소선 여사님께서는 노동 운동 및 민주화 운동을 벌이면서 노동운동의 대모라 불려왔습니다.










삼가 고인의 명복을 빕니다.






 
Posted by 삼성동고양이


손가락 꾸~~욱 눌러주세요 ^ㅡ^
>>>>><<<<<


회사에서 추석이라고 재래 시장 상품권을 주네요. 1만원짜리 20장 20만원 어치의 재래시장 상품권을 받아서 이번 추석을 위한 물품을 구입했어요.  재래시장 














돈이 아니라 상품권인데 만질때는 참 돈을 만지는 기분으로 잘만들었더라구요. 돈을 받은 듯한 뿌듯함?^^;; 하지만 추석에 정말 돈이 많이 들어가는 군요. 추석 물품을 조금 샀을 뿐인데 벌써 그 20장이 다 사라졌어요. ㅠㅠ.

재래 시장 상품권은 안에 동봉 되어 있는 재래 시장 상품권을 이용할 수 있는 각 시장에서 구입할 수 있구요. 재래 시장 상품권을 사용할 수 있게 가입이 되어있다면 동네 슈퍼에서도 쓸 수 있는 걸로 알고 있어요. ^^ 이 상품권을 받은 이후로 인터넷에 보니 19만원에 팝니다 라는 판매 메세지가 많던데, 다들 부모님이나 아내 분에게 전달해 보세요. 정말 큰 사랑 받을 수 있답니다.^^ 어머니께서 그렇게 환히 웃는거 진짜 오랜만에 본듯..^^;;; 



여기서 언급하고 싶은 내용을 추가합니다.
재래 시장 상품권은 재래시장의 시장 활성화를 목적으로 유통되는 상품권인데, 사실 재래시장 상품권의 영향으로 훨씬 더 많은 재래시장 이용객들이 많아지는건 사실인것 같습니다. 하지만 이 상품권으로 재래시장을 이용하기 위해 막상 나섰을때는 크게 두가지의 문제점이 있었습니다.

1. 사용가능한 재래시장이 각 도시별로 많은 것이 아니라 특정 지역에 많이 분포 되어있다. 
    몇몇 도시는 선택할 수 있는 시장이 많지 않다.

2. 재래시장 상품권을 사용하기 위해 재래시장을 찾았을때에, 주차 할 곳이 없다.

특히 2번에 대해서 언급하고 싶은데, 흔히 재래시장의 대체재를 E-mart같은 대형 마트로 비교를 한다면, 대형 마트는 주차를 할 곳이 충분할 뿐더러 무료이고, 주차 안내하는 인원들도 있어서 주차에 대해서 고민이 크게 많지 않은 편입니다. 하지만 이번 시장 상품권을 쓰러 갔을때에는 도데체 3바퀴를 돌고 동네를 안으로 들어가도 주차를 할 곳이 전혀 없어서 그냥 나올려다가 우연히 빠지는 차 한대를 발견하고 그 자리에 주차를 하고 물건을 살 수 있었습니다. 재래시장에서는 1~2개의 물건을 사기 보다는 필요한 물건을 많이 사는 목적으로 많이 방문할 텐데, 내부에 들어갔더니 그다지 북적이지 않는데도 불구하고, 주차는 할곳이 없을뿐더러 불법 주차도 만차더군요.

재래 시장 상품권과 더불어 재래시장의 활성화를 위해서, 주차에 대한 방안이 재래시장의 활성화의 큰 영향을 줄 것이라고 생각합니다.

다시말해 재래시장을 방문하실땐, 주차를 먼저 고려하고 찾지 않으면, 저처럼 엄청나게 고생하실지도 몰라요^^;;;;;
재래시장엔 지하 주차장이 없거든요^^;;;






 
Posted by 삼성동고양이

수퍼 네츄럴 시즌 7이 나왔네요. 나온지는 꽤 됬는데 저는 지금 봤네요.ㅠㅠ 제가 제일 좋아하는 Supernatural 이제 새로운 시즌이 다시 시작하겠네요.

 

 === 슈퍼 네추럴 시즌 7 티져 ===

 








9월 23일 첫 방송이네요.^^
 아 정말 기대 됩니다. 이번 시즌 7에서는 마지막 시즌 6에 나왔듯이 캐스(카스티엘)이 자신이 새로운 신이라고 언급을 하는거 봐서는 그것에 관련된 스토리가 나오지 않을까 생각합니다. 새로운 신으로 거듭나려는 캐스와 딘과 샘 윈체스터 형제들의 무언가 연결이 되어서 스토리를 이어가겠죠. 이 슈퍼 네츄럴은 제가 가장 좋아하며 가장 만족하는 드라마 입니다. 이번에도 엄청난 고민을 하겠군요 다음 두가지 중에..

매 에피소드마다 챙겨 볼 것인가 vs 모든 에피소드가 끝난 다음에 볼 것인가.

둘중에 어떤것을 봐야 할지 거정되네요^^;;; 
 


 





 

 







Posted by 삼성동고양이
이전버튼 1 2 3 4 5 6 이전버튼