title: Compile RAID controller device driver (linux kernel module)
body: <p>I have an adaptec 6805e RAID controller and I'm looking to compile the linux driver for ubuntu 20.04 (kernel=v5.4) but there have been a vast number of changes between kernel ~4x =&gt; 5x and I'm not a kernel developer.</p>
  <pre><code>OS:
  Ubuntu LTS 20.04
  
  Kernel:
  v5.4
  
  Adaptec 6805e:
  https://storage.microsemi.com/en-us/support/raid/sas_raid/sas-6805e/
  </code></pre>
  <p>Any obvious major hurdles, or advice is appreciated, but right now the issue I'm having is trying to find a replacement for the 'pci_set_dma_max_seg_size' function. I have found the 'dma_set_max_seg_size' but that function accepts a generic device structure (struct device), whereas the adaptec code is using the (struct pci_dev) structure that seems to be specific for PCI devices.</p>
  <pre><code>aacraid-1.2.1-52011/linit.c:3992:10: error: implicit declaration of function ‘pci_set_dma_max_seg_size’; did you mean ‘dma_set_max_seg_size’? [-Werror=implicit-function-declaration]
   3992 |  error = pci_set_dma_max_seg_size(pdev,
  </code></pre>
  <p>Like I said any help is appreciated and if this seems like the wrong way to resolve this problem I'm open to ideas -- I'd like to be able to utilize the benefits of more recent linux developments with a slightly older adaptec chipset.</p>
  <p>Thanks</p>
  <p>Reference materials:
  <a href="https://elixir.bootlin.com/linux/v5.4.128/source/include/linux" rel="nofollow noreferrer">https://elixir.bootlin.com/linux/v5.4.128/source/include/linux</a></p>