1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

For a Linux client

Discussion in 'General Discussion' started by Seungjin Lee, Dec 2, 2017.

  1. Seungjin Lee

    Seungjin Lee Member

    Hi, :)

    Until now I have been thinking Linux would work well as an Across Client like most of other OS's, but it doesn't. For a Linux client to work properly, you need to add one line patch to your kernel source.

    Please add the one line (hid->quirks = HID_QUIRK_MULTI_INPUT;) into /net/bluetooth/hidp/core.c from your kernel source:
    Code:
    /* This function sets up the hid device. It does not add it
       to the HID system. That is done in hidp_add_connection(). */
    static int hidp_setup_hid(struct hidp_session *session,
                    struct hidp_connadd_req *req)
    {
        struct hid_device *hid;
        int err;
    
        session->rd_data = memdup_user(req->rd_data, req->rd_size);
        if (IS_ERR(session->rd_data))
            return PTR_ERR(session->rd_data);
    
        session->rd_size = req->rd_size;
    
        hid = hid_allocate_device();
        if (IS_ERR(hid)) {
            err = PTR_ERR(hid);
            goto fault;
        }
    
        session->hid = hid;
    
        hid->driver_data = session;
    
        hid->bus     = BUS_BLUETOOTH;
        hid->vendor  = req->vendor;
        hid->product = req->product;
        hid->version = req->version;
        hid->country = req->country;
    
        hid->quirks = HID_QUIRK_MULTI_INPUT;
    
        strncpy(hid->name, req->name, sizeof(req->name) - 1);
    
        snprintf(hid->phys, sizeof(hid->phys), "%pMR",
             &l2cap_pi(session->ctrl_sock->sk)->chan->src);
    
        /* NOTE: Some device modules depend on the dst address being stored in
         * uniq. Please be aware of this before making changes to this behavior.
         */
        snprintf(hid->uniq, sizeof(hid->uniq), "%pMR",
             &l2cap_pi(session->ctrl_sock->sk)->chan->dst);
    
        hid->dev.parent = &session->conn->hcon->dev;
        hid->ll_driver = &hidp_hid_driver;
    
        /* True if device is blacklisted in drivers/hid/hid-core.c */
        if (hid_ignore(hid)) {
            hid_destroy_device(session->hid);
            session->hid = NULL;
            return -ENODEV;
        }
    
        return 0;
    
    fault:
        kfree(session->rd_data);
        session->rd_data = NULL;
    
        return err;
    }
    PS: Please do googling about how to get the kernel source, patch and build it.
     
    Last edited: Dec 2, 2017

Share This Page