MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xlp_sec_attach

Function xlp_sec_attach

freebsd/mips/nlm/dev/sec/nlmsec.c:323–363  ·  view source on GitHub ↗

* Attach an interface that successfully probed. */

Source from the content-addressed store, hash-verified

321 * Attach an interface that successfully probed.
322 */
323static int
324xlp_sec_attach(device_t dev)
325{
326 struct xlp_sec_softc *sc = device_get_softc(dev);
327 uint64_t base;
328 int qstart, qnum;
329 int freq, node;
330
331 sc->sc_dev = dev;
332
333 node = nlm_get_device_node(pci_get_slot(dev));
334 freq = nlm_set_device_frequency(node, DFS_DEVICE_SAE, 250);
335 if (bootverbose)
336 device_printf(dev, "SAE Freq: %dMHz\n", freq);
337 if(pci_get_device(dev) == PCI_DEVICE_ID_NLM_SAE) {
338 device_set_desc(dev, "XLP Security Accelerator");
339 sc->sc_cid = crypto_get_driverid(dev,
340 sizeof(struct xlp_sec_session), CRYPTOCAP_F_HARDWARE);
341 if (sc->sc_cid < 0) {
342 printf("xlp_sec - error : could not get the driver"
343 " id\n");
344 goto error_exit;
345 }
346
347 base = nlm_get_sec_pcibase(node);
348 qstart = nlm_qidstart(base);
349 qnum = nlm_qnum(base);
350 sc->sec_vc_start = qstart;
351 sc->sec_vc_end = qstart + qnum - 1;
352 }
353
354 if (xlp_sec_init(sc) != 0)
355 goto error_exit;
356 if (bootverbose)
357 device_printf(dev, "SEC Initialization complete!\n");
358 return (0);
359
360error_exit:
361 return (ENXIO);
362
363}
364
365/*
366 * Detach an interface that successfully probed.

Callers

nothing calls this directly

Calls 10

device_get_softcFunction · 0.85
nlm_get_device_nodeFunction · 0.85
nlm_set_device_frequencyFunction · 0.85
device_printfFunction · 0.85
device_set_descFunction · 0.85
crypto_get_driveridFunction · 0.85
nlm_qidstartFunction · 0.85
nlm_qnumFunction · 0.85
xlp_sec_initFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected