Re: Re: Kernel timers problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 


On Fri, 06 May 2005 Thomas Petazzoni wrote :
>Hello,
>
>vaishali paisal wrote:
>
>>so each time a connection is added hci_conn_add is called and a new timer would be initialised through hci_conn_init_timer.
>
>Here is the interesting part of hci_conn_add() :
>
>struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
>{
>        struct hci_conn *conn;
>
>        BT_DBG("%s dst %s", hdev->name, batostr(dst));
>
>        if (!(conn = kmalloc(sizeof(struct hci_conn), GFP_ATOMIC)))
>                return NULL;
>        memset(conn, 0, sizeof(struct hci_conn));
>
>        [...]
>
>        hci_conn_init_timer(conn);
>
>        [...]
>}
>
>Conclusion: a new "hci_conn" structure is allocated (using kmalloc) everytime this function is called. And there is one "struct timer_list" in each "hci_conn" structure.
>
>Others: If I say something wrong, don't hesitate to tell me.
>
>Thomas
>-- Thomas Petazzoni
>thomas.petazzoni@xxxxxxxx


yeah you are very correct about it.I too found that today.What I am doing now is making a global array of pointers to struct timer_list and allocating memory using kmalloc for my timers.This is working now.
Thanks a lot for your prompt replies.

Regards
vaishali




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux