Lines Matching refs:cobra

28 struct cobra {  struct
93 struct cobra *cobra = gameport_get_drvdata(gameport); in cobra_poll() local
98 cobra->reads++; in cobra_poll()
100 if ((r = cobra_read_packet(gameport, data)) != cobra->exists) { in cobra_poll()
101 cobra->bads++; in cobra_poll()
106 if (cobra->exists & r & (1 << i)) { in cobra_poll()
108 dev = cobra->dev[i]; in cobra_poll()
123 struct cobra *cobra = input_get_drvdata(dev); in cobra_open() local
125 gameport_start_polling(cobra->gameport); in cobra_open()
131 struct cobra *cobra = input_get_drvdata(dev); in cobra_close() local
133 gameport_stop_polling(cobra->gameport); in cobra_close()
138 struct cobra *cobra; in cobra_connect() local
144 cobra = kzalloc(sizeof(struct cobra), GFP_KERNEL); in cobra_connect()
145 if (!cobra) in cobra_connect()
148 cobra->gameport = gameport; in cobra_connect()
150 gameport_set_drvdata(gameport, cobra); in cobra_connect()
156 cobra->exists = cobra_read_packet(gameport, data); in cobra_connect()
159 if ((cobra->exists >> i) & data[i] & 1) { in cobra_connect()
162 cobra->exists &= ~(1 << i); in cobra_connect()
165 if (!cobra->exists) { in cobra_connect()
174 if (~(cobra->exists >> i) & 1) in cobra_connect()
177 cobra->dev[i] = input_dev = input_allocate_device(); in cobra_connect()
183 snprintf(cobra->phys[i], sizeof(cobra->phys[i]), in cobra_connect()
187 input_dev->phys = cobra->phys[i]; in cobra_connect()
194 input_set_drvdata(input_dev, cobra); in cobra_connect()
205 err = input_register_device(cobra->dev[i]); in cobra_connect()
212 fail4: input_free_device(cobra->dev[i]); in cobra_connect()
214 if (cobra->dev[i]) in cobra_connect()
215 input_unregister_device(cobra->dev[i]); in cobra_connect()
218 kfree(cobra); in cobra_connect()
224 struct cobra *cobra = gameport_get_drvdata(gameport); in cobra_disconnect() local
228 if ((cobra->exists >> i) & 1) in cobra_disconnect()
229 input_unregister_device(cobra->dev[i]); in cobra_disconnect()
232 kfree(cobra); in cobra_disconnect()